mirror of
https://github.com/bitwarden/clients.git
synced 2026-06-04 21:04:29 +08:00
PM-38423 - FIx unsavedSendEditsGuard not handling null component emission on logout while component is active. (#20967)
This commit is contained in:
parent
157134f500
commit
82246bea68
@ -3,5 +3,10 @@ import { CanDeactivateFn } from "@angular/router";
|
||||
import { SendComponent } from "../send.component";
|
||||
|
||||
export const unsavedSendEditsGuard: CanDeactivateFn<SendComponent> = async (component) => {
|
||||
// Angular passes null when the component has already been destroyed mid-navigation
|
||||
// (e.g. during logout teardown). No edits to save in that case — allow the navigation.
|
||||
if (component == null) {
|
||||
return true;
|
||||
}
|
||||
return component.saveUnsavedSendEdits();
|
||||
};
|
||||
|
||||
@ -3,5 +3,10 @@ import { CanDeactivateFn } from "@angular/router";
|
||||
import { SendComponent } from "../send/send.component";
|
||||
|
||||
export const unsavedSendEditsGuard: CanDeactivateFn<SendComponent> = async (component) => {
|
||||
// Angular passes null when the component has already been destroyed mid-navigation
|
||||
// (e.g. during logout teardown). No edits to save in that case — allow the navigation.
|
||||
if (component == null) {
|
||||
return true;
|
||||
}
|
||||
return component.saveUnsavedSendEdits();
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user