1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

bootstrap async

This commit is contained in:
Kyle Spearrin 2017-12-05 23:37:32 -05:00
parent e90476af2b
commit 72ac90157f
2 changed files with 8 additions and 9 deletions

View File

@ -4,7 +4,7 @@ import i18nService from './services/i18nService.js';
window.forge = require('node-forge');
window.tldjs = require('tldjs');
window.bg_isBackground = true;
window.bg_main = new MainBackground(new i18nService());
const bg_isBackground = window.bg_isBackground = true;
const bg_main = window.bg_main = new MainBackground(new i18nService());
require('./scripts/analytics.js');
window.bg_main.bootstrap();
bg_main.bootstrap();

View File

@ -82,7 +82,7 @@ export default class MainBackground {
opr.sidebarAction : (window as any).chrome.sidebarAction;
}
bootstrap() {
async bootstrap() {
// Chrome APIs
if (chrome.commands) {
chrome.commands.onCommand.addListener((command: any) => {
@ -323,11 +323,10 @@ export default class MainBackground {
}
// Bootstrap
this.environmentService.setUrlsFromStorage().then(() => {
this.setIcon();
this.cleanupLoginsToAdd();
this.fullSync(true);
});
await this.environmentService.setUrlsFromStorage();
this.setIcon();
this.cleanupLoginsToAdd();
this.fullSync(true);
}
private completeAuthRequest(details: any) {