Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix dialogs not closing when app gets locked

Abdullah Attad88ead4609a5
diff --git a/apps/web/src/views/app-lock.tsx b/apps/web/src/views/app-lock.tsx
index cbd5f5edf..c1018bf37 100644
--- a/apps/web/src/views/app-lock.tsx
+++ b/apps/web/src/views/app-lock.tsx
@@ -36,6 +36,7 @@ import { WebAuthn } from "../utils/webauthn";
import { getDocumentTitle, setDocumentTitle } from "../utils/dom";
import { CredentialWithoutSecret, useKeyStore } from "../interfaces/key-store";
import { strings } from "@notesnook/intl";
+import { DialogManager } from "../common/dialog-manager";
export default function AppLock(props: PropsWithChildren<unknown>) {
const credentials = useKeyStore((store) => store.activeCredentials());
@@ -119,6 +120,12 @@ export default function AppLock(props: PropsWithChildren<unknown>) {
}
}, [lockAfter, credentials]);
+ useEffect(() => {
+ if (isLocked) {
+ DialogManager.closeAll();
+ }
+ }, [isLocked]);
+
if (isLocked)
return (
<Flex