mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +00:00
[PM-14214] Initialize PopupViewCacheService earlier (#13540)
This commit is contained in:
@@ -24,7 +24,6 @@ import {
|
|||||||
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
|
import { BiometricsService, BiometricStateService } from "@bitwarden/key-management";
|
||||||
|
|
||||||
import { PopupCompactModeService } from "../platform/popup/layout/popup-compact-mode.service";
|
import { PopupCompactModeService } from "../platform/popup/layout/popup-compact-mode.service";
|
||||||
import { PopupViewCacheService } from "../platform/popup/view-cache/popup-view-cache.service";
|
|
||||||
import { initPopupClosedListener } from "../platform/services/popup-view-cache-background.service";
|
import { initPopupClosedListener } from "../platform/services/popup-view-cache-background.service";
|
||||||
import { VaultBrowserStateService } from "../vault/services/vault-browser-state.service";
|
import { VaultBrowserStateService } from "../vault/services/vault-browser-state.service";
|
||||||
|
|
||||||
@@ -43,7 +42,6 @@ import { DesktopSyncVerificationDialogComponent } from "./components/desktop-syn
|
|||||||
`,
|
`,
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit, OnDestroy {
|
export class AppComponent implements OnInit, OnDestroy {
|
||||||
private viewCacheService = inject(PopupViewCacheService);
|
|
||||||
private compactModeService = inject(PopupCompactModeService);
|
private compactModeService = inject(PopupCompactModeService);
|
||||||
|
|
||||||
private lastActivity: Date;
|
private lastActivity: Date;
|
||||||
@@ -74,7 +72,6 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
initPopupClosedListener();
|
initPopupClosedListener();
|
||||||
await this.viewCacheService.init();
|
|
||||||
|
|
||||||
this.compactModeService.init();
|
this.compactModeService.init();
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import { StateService } from "@bitwarden/common/platform/abstractions/state.serv
|
|||||||
import { BrowserApi } from "../../platform/browser/browser-api";
|
import { BrowserApi } from "../../platform/browser/browser-api";
|
||||||
import BrowserPopupUtils from "../../platform/popup/browser-popup-utils";
|
import BrowserPopupUtils from "../../platform/popup/browser-popup-utils";
|
||||||
import { PopupSizeService } from "../../platform/popup/layout/popup-size.service";
|
import { PopupSizeService } from "../../platform/popup/layout/popup-size.service";
|
||||||
|
import { PopupViewCacheService } from "../../platform/popup/view-cache/popup-view-cache.service";
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class InitService {
|
export class InitService {
|
||||||
private sizeService = inject(PopupSizeService);
|
private sizeService = inject(PopupSizeService);
|
||||||
@@ -24,6 +26,7 @@ export class InitService {
|
|||||||
private logService: LogServiceAbstraction,
|
private logService: LogServiceAbstraction,
|
||||||
private themingService: AbstractThemingService,
|
private themingService: AbstractThemingService,
|
||||||
private sdkLoadService: SdkLoadService,
|
private sdkLoadService: SdkLoadService,
|
||||||
|
private viewCacheService: PopupViewCacheService,
|
||||||
@Inject(DOCUMENT) private document: Document,
|
@Inject(DOCUMENT) private document: Document,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@@ -33,7 +36,7 @@ export class InitService {
|
|||||||
await this.stateService.init({ runMigrations: false }); // Browser background is responsible for migrations
|
await this.stateService.init({ runMigrations: false }); // Browser background is responsible for migrations
|
||||||
await this.i18nService.init();
|
await this.i18nService.init();
|
||||||
this.twoFactorService.init();
|
this.twoFactorService.init();
|
||||||
|
await this.viewCacheService.init();
|
||||||
await this.sizeService.init();
|
await this.sizeService.init();
|
||||||
|
|
||||||
const htmlEl = window.document.documentElement;
|
const htmlEl = window.document.documentElement;
|
||||||
|
|||||||
Reference in New Issue
Block a user