mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
[PM-3020] Change initialization of EnvironmentService to default to uninitialized (#5830)
* Set initialized to false on construction of the EnvironmentService * Add initialization on browser and desktop. * Added comments.
This commit is contained in:
@@ -676,6 +676,9 @@ export default class MainBackground {
|
||||
return new Promise<void>((resolve) => {
|
||||
setTimeout(async () => {
|
||||
await this.environmentService.setUrlsFromStorage();
|
||||
// Workaround to ignore stateService.activeAccount until URLs are set
|
||||
// TODO: Remove this when implementing ticket PM-2637
|
||||
this.environmentService.initialized = true;
|
||||
if (!this.isPrivateMode) {
|
||||
await this.refreshBadge();
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ export class InitService {
|
||||
this.nativeMessagingService.init();
|
||||
await this.stateService.init();
|
||||
await this.environmentService.setUrlsFromStorage();
|
||||
// Workaround to ignore stateService.activeAccount until URLs are set
|
||||
// TODO: Remove this when implementing ticket PM-2637
|
||||
this.environmentService.initialized = true;
|
||||
this.syncService.fullSync(true);
|
||||
(this.vaultTimeoutService as VaultTimeoutService).init(true);
|
||||
const locale = await this.stateService.getLocale();
|
||||
|
||||
@@ -38,14 +38,13 @@ export class InitService {
|
||||
|
||||
init() {
|
||||
return async () => {
|
||||
// Workaround to ignore stateService.activeAccount until process.env.URLS are set
|
||||
// TODO: Remove this when implementing ticket PM-2637
|
||||
this.environmentService.initialized = false;
|
||||
await this.stateService.init();
|
||||
|
||||
const urls = process.env.URLS as Urls;
|
||||
urls.base ??= this.win.location.origin;
|
||||
await this.environmentService.setUrls(urls);
|
||||
// Workaround to ignore stateService.activeAccount until process.env.URLS are set
|
||||
// TODO: Remove this when implementing ticket PM-2637
|
||||
this.environmentService.initialized = true;
|
||||
|
||||
setTimeout(() => this.notificationsService.init(), 3000);
|
||||
|
||||
Reference in New Issue
Block a user