mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-11 10:10:25 +01:00
Remove Some Unneccesary Async From Init Methods (#10485)
This commit is contained in:
parent
11eba8d779
commit
a7da5bb40f
@ -137,8 +137,8 @@ describe("NotificationBackground", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("notification bar extension message handlers", () => {
|
describe("notification bar extension message handlers", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(() => {
|
||||||
await notificationBackground.init();
|
notificationBackground.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("ignores messages whose command does not match the expected handlers", () => {
|
it("ignores messages whose command does not match the expected handlers", () => {
|
||||||
|
@ -94,7 +94,7 @@ export default class NotificationBackground {
|
|||||||
private accountService: AccountService,
|
private accountService: AccountService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async init() {
|
init() {
|
||||||
if (chrome.runtime == null) {
|
if (chrome.runtime == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ export default class CommandsBackground {
|
|||||||
this.isVivaldi = this.platformUtilsService.isVivaldi();
|
this.isVivaldi = this.platformUtilsService.isVivaldi();
|
||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
init() {
|
||||||
BrowserApi.messageListener("commands.background", (msg: any) => {
|
BrowserApi.messageListener("commands.background", (msg: any) => {
|
||||||
if (msg.command === "unlockCompleted" && msg.data.target === "commands.background") {
|
if (msg.command === "unlockCompleted" && msg.data.target === "commands.background") {
|
||||||
this.processCommand(
|
this.processCommand(
|
||||||
|
@ -23,7 +23,7 @@ export default class IdleBackground {
|
|||||||
this.idle = chrome.idle || (browser != null ? browser.idle : null);
|
this.idle = chrome.idle || (browser != null ? browser.idle : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
init() {
|
||||||
if (!this.idle) {
|
if (!this.idle) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1238,11 +1238,11 @@ export default class MainBackground {
|
|||||||
await this.vaultTimeoutService.init(true);
|
await this.vaultTimeoutService.init(true);
|
||||||
this.fido2Background.init();
|
this.fido2Background.init();
|
||||||
await this.runtimeBackground.init();
|
await this.runtimeBackground.init();
|
||||||
await this.notificationBackground.init();
|
this.notificationBackground.init();
|
||||||
this.filelessImporterBackground.init();
|
this.filelessImporterBackground.init();
|
||||||
await this.commandsBackground.init();
|
this.commandsBackground.init();
|
||||||
this.contextMenusBackground?.init();
|
this.contextMenusBackground?.init();
|
||||||
await this.idleBackground.init();
|
this.idleBackground.init();
|
||||||
this.webRequestBackground?.startListening();
|
this.webRequestBackground?.startListening();
|
||||||
this.syncServiceListener?.listener$().subscribe();
|
this.syncServiceListener?.listener$().subscribe();
|
||||||
await this.autoSubmitLoginBackground.init();
|
await this.autoSubmitLoginBackground.init();
|
||||||
|
Loading…
Reference in New Issue
Block a user