1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

[PM-3783] chore: remove ngZone.run calls

No longer needed now that we have zone-patches for `chrome.runtime.onMessage`
This commit is contained in:
Andreas Coroiu
2023-09-05 14:17:02 +02:00
parent 182d5bf5ac
commit 10c8286d69

View File

@@ -86,7 +86,6 @@ export class AppComponent implements OnInit, OnDestroy {
sendResponse: any sendResponse: any
) => { ) => {
if (msg.command === "doneLoggingOut") { if (msg.command === "doneLoggingOut") {
this.ngZone.run(async () => {
this.authService.logOut(async () => { this.authService.logOut(async () => {
if (msg.expired) { if (msg.expired) {
this.showToast({ this.showToast({
@@ -101,16 +100,11 @@ export class AppComponent implements OnInit, OnDestroy {
} }
}); });
this.changeDetectorRef.detectChanges(); this.changeDetectorRef.detectChanges();
});
} else if (msg.command === "authBlocked") { } else if (msg.command === "authBlocked") {
this.ngZone.run(() => {
this.router.navigate(["home"]); this.router.navigate(["home"]);
});
} else if (msg.command === "locked") { } else if (msg.command === "locked") {
if (msg.userId == null || msg.userId === (await this.stateService.getUserId())) { if (msg.userId == null || msg.userId === (await this.stateService.getUserId())) {
this.ngZone.run(() => {
this.router.navigate(["lock"]); this.router.navigate(["lock"]);
});
} }
} else if (msg.command === "showDialog") { } else if (msg.command === "showDialog") {
await this.showDialog(msg); await this.showDialog(msg);
@@ -118,9 +112,7 @@ export class AppComponent implements OnInit, OnDestroy {
// TODO: Should be refactored to live in another service. // TODO: Should be refactored to live in another service.
await this.showNativeMessagingFingerprintDialog(msg); await this.showNativeMessagingFingerprintDialog(msg);
} else if (msg.command === "showToast") { } else if (msg.command === "showToast") {
this.ngZone.run(() => {
this.showToast(msg); this.showToast(msg);
});
} else if (msg.command === "reloadProcess") { } else if (msg.command === "reloadProcess") {
const forceWindowReload = const forceWindowReload =
this.platformUtilsService.isSafari() || this.platformUtilsService.isSafari() ||
@@ -132,13 +124,9 @@ export class AppComponent implements OnInit, OnDestroy {
2000 2000
); );
} else if (msg.command === "reloadPopup") { } else if (msg.command === "reloadPopup") {
this.ngZone.run(() => {
this.router.navigate(["/"]); this.router.navigate(["/"]);
});
} else if (msg.command === "convertAccountToKeyConnector") { } else if (msg.command === "convertAccountToKeyConnector") {
this.ngZone.run(async () => {
this.router.navigate(["/remove-password"]); this.router.navigate(["/remove-password"]);
});
} else { } else {
msg.webExtSender = sender; msg.webExtSender = sender;
this.broadcasterService.send(msg); this.broadcasterService.send(msg);