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";
import * as pako from "pako";
import { DialogConfirmComponent } from "./components/dialog-confirm/dialog-confirm.component";
import { UserConfirmationService } from "./services/user-confirmation.service";
import { ServiceWorkerUpdateService } from "./services/service-worker-update.service";
@Component({
selector: "nghyd-app",
......@@ -87,6 +88,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
private hotkeysService: HotkeysService,
private matomoTracker: MatomoTracker,
private confirmDialog: MatDialog,
private serviceWorkerUpdateService: ServiceWorkerUpdateService,
private userConfirmationService: UserConfirmationService
) {
ServiceFactory.httpService = httpService;
......@@ -94,6 +96,7 @@ export class AppComponent implements OnInit, OnDestroy, Observer {
ServiceFactory.i18nService = intlService;
ServiceFactory.formulaireService = formulaireService;
ServiceFactory.notificationsService = notificationsService;
ServiceFactory.serviceWorkerUpdateService = serviceWorkerUpdateService;
if (!isDevMode()) {
// évite de mettre en place un bandeau RGPD
......
......@@ -4,6 +4,7 @@ import { I18nService } from "./internationalisation.service";
import { HttpService } from "./http.service";
import { NotificationsService } from "./notifications.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
......@@ -17,11 +18,13 @@ export const ServiceFactory: {
httpService: HttpService;
notificationsService: NotificationsService;
prebarrageService: PrebarrageService;
serviceWorkerUpdateService: ServiceWorkerUpdateService;
} = {
applicationSetupService: undefined,
formulaireService: undefined,
i18nService: undefined,
httpService: 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