Adds ServiceWorker Service

Adds ServiceWorker Service for Updating PWA
This commit is contained in:
2023-08-28 03:48:05 -03:00
parent f6afe859c3
commit da3382b74e
4 changed files with 52 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { AuthService } from './shared/auth/auth.service';
import {UpdateService} from "./shared/service-worker/update.service";
@Component({
selector: 'app-root',
@@ -7,10 +8,12 @@ import { AuthService } from './shared/auth/auth.service';
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'frontend-hideyoshi.com';
constructor(private authService: AuthService) {}
constructor(private authService: AuthService, private serviceWorker: UpdateService) {
this.serviceWorker.checkForUpdates();
}
ngOnInit(): void {
this.authService.autoLogin();