From 528af15eb0efd30e8ddf198bdc5741032db3c1c5 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Fri, 22 Jul 2022 12:41:02 -0400 Subject: [PATCH] Do not use deprecated method (#3155) --- apps/browser/src/background/main.background.ts | 2 +- apps/cli/src/bw.ts | 2 +- apps/web/src/app/services/init.service.ts | 2 +- libs/common/src/services/container.service.ts | 5 ----- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index cfc66fe02b..6f359c9558 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -517,7 +517,7 @@ export default class MainBackground { } async bootstrap() { - this.containerService.attachToWindow(window); + this.containerService.attachToGlobal(window); await this.stateService.init(); diff --git a/apps/cli/src/bw.ts b/apps/cli/src/bw.ts index fe0391772c..6c217a7569 100644 --- a/apps/cli/src/bw.ts +++ b/apps/cli/src/bw.ts @@ -377,7 +377,7 @@ export class Main { private async init() { await this.storageService.init(); await this.stateService.init(); - this.containerService.attachToWindow(global); + this.containerService.attachToGlobal(global); await this.environmentService.setUrlsFromStorage(); const locale = await this.stateService.getLocale(); await this.i18nService.init(locale); diff --git a/apps/web/src/app/services/init.service.ts b/apps/web/src/app/services/init.service.ts index 047a28da18..0ab752c8f7 100644 --- a/apps/web/src/app/services/init.service.ts +++ b/apps/web/src/app/services/init.service.ts @@ -52,7 +52,7 @@ export class InitService { htmlEl.classList.add("locale_" + this.i18nService.translationLocale); await this.themingService.monitorThemeChanges(); const containerService = new ContainerService(this.cryptoService); - containerService.attachToWindow(this.win); + containerService.attachToGlobal(this.win); }; } } diff --git a/libs/common/src/services/container.service.ts b/libs/common/src/services/container.service.ts index 2880e7c780..848a8b0389 100644 --- a/libs/common/src/services/container.service.ts +++ b/libs/common/src/services/container.service.ts @@ -3,11 +3,6 @@ import { CryptoService } from "../abstractions/crypto.service"; export class ContainerService { constructor(private cryptoService: CryptoService) {} - // deprecated, use attachToGlobal instead - attachToWindow(win: any) { - this.attachToGlobal(win); - } - attachToGlobal(global: any) { if (!global.bitwardenContainerService) { global.bitwardenContainerService = this;