Skip to content
Snippets Groups Projects
Commit 3de02bcc authored by François Grand's avatar François Grand
Browse files

refactor: add service worker update service to service factory

refs #604
parent be94a75d
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!206Resolve "PWA: l'application ne se met pas à jour"
...@@ -35,6 +35,7 @@ import * as XLSX from "xlsx"; ...@@ -35,6 +35,7 @@ import * as XLSX from "xlsx";
import * as pako from "pako"; import * as pako from "pako";
import { DialogConfirmComponent } from "./components/dialog-confirm/dialog-confirm.component"; import { DialogConfirmComponent } from "./components/dialog-confirm/dialog-confirm.component";
import { UserConfirmationService } from "./services/user-confirmation.service"; import { UserConfirmationService } from "./services/user-confirmation.service";
import { ServiceWorkerUpdateService } from "./services/service-worker-update.service";
@Component({ @Component({
selector: "nghyd-app", selector: "nghyd-app",
...@@ -87,6 +88,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -87,6 +88,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
private hotkeysService: HotkeysService, private hotkeysService: HotkeysService,
private matomoTracker: MatomoTracker, private matomoTracker: MatomoTracker,
private confirmDialog: MatDialog, private confirmDialog: MatDialog,
private serviceWorkerUpdateService: ServiceWorkerUpdateService,
private userConfirmationService: UserConfirmationService private userConfirmationService: UserConfirmationService
) { ) {
ServiceFactory.httpService = httpService; ServiceFactory.httpService = httpService;
...@@ -94,6 +96,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer { ...@@ -94,6 +96,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
ServiceFactory.i18nService = intlService; ServiceFactory.i18nService = intlService;
ServiceFactory.formulaireService = formulaireService; ServiceFactory.formulaireService = formulaireService;
ServiceFactory.notificationsService = notificationsService; ServiceFactory.notificationsService = notificationsService;
ServiceFactory.serviceWorkerUpdateService = serviceWorkerUpdateService;
if (!isDevMode()) { if (!isDevMode()) {
// évite de mettre en place un bandeau RGPD // évite de mettre en place un bandeau RGPD
......
...@@ -4,6 +4,7 @@ import { I18nService } from "./internationalisation.service"; ...@@ -4,6 +4,7 @@ import { I18nService } from "./internationalisation.service";
import { HttpService } from "./http.service"; import { HttpService } from "./http.service";
import { NotificationsService } from "./notifications.service"; import { NotificationsService } from "./notifications.service";
import { PrebarrageService } from "./prebarrage.service"; import { PrebarrageService } from "./prebarrage.service";
import { ServiceWorkerUpdateService } from "./service-worker-update.service";
/** /**
* A "Singleton" the TS way, that holds pointers to all services, to be accessed * A "Singleton" the TS way, that holds pointers to all services, to be accessed
...@@ -17,11 +18,13 @@ export const ServiceFactory: { ...@@ -17,11 +18,13 @@ export const ServiceFactory: {
httpService: HttpService; httpService: HttpService;
notificationsService: NotificationsService; notificationsService: NotificationsService;
prebarrageService: PrebarrageService; prebarrageService: PrebarrageService;
serviceWorkerUpdateService: ServiceWorkerUpdateService;
} = { } = {
applicationSetupService: undefined, applicationSetupService: undefined,
formulaireService: undefined, formulaireService: undefined,
i18nService: undefined, i18nService: undefined,
httpService: undefined, httpService: undefined,
notificationsService: undefined, notificationsService: undefined,
prebarrageService: undefined prebarrageService: undefined,
serviceWorkerUpdateService: undefined
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment