Browse Source

Do not use deprecated method (#3155)

pull/3165/head
Matt Gibson 3 years ago committed by GitHub
parent
commit
528af15eb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/browser/src/background/main.background.ts
  2. 2
      apps/cli/src/bw.ts
  3. 2
      apps/web/src/app/services/init.service.ts
  4. 5
      libs/common/src/services/container.service.ts

2
apps/browser/src/background/main.background.ts

@ -517,7 +517,7 @@ export default class MainBackground { @@ -517,7 +517,7 @@ export default class MainBackground {
}
async bootstrap() {
this.containerService.attachToWindow(window);
this.containerService.attachToGlobal(window);
await this.stateService.init();

2
apps/cli/src/bw.ts

@ -377,7 +377,7 @@ export class Main { @@ -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);

2
apps/web/src/app/services/init.service.ts

@ -52,7 +52,7 @@ export class InitService { @@ -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);
};
}
}

5
libs/common/src/services/container.service.ts

@ -3,11 +3,6 @@ import { CryptoService } from "../abstractions/crypto.service"; @@ -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;

Loading…
Cancel
Save