mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-05 16:16:49 +00:00
# Conflicts: # components/settings/general-settings.tsx # hooks/use-calendar-alerts.ts # lib/desktop/app-lock-state.ts # lib/desktop/policy-schema.ts # lib/desktop/types.ts
21 lines
805 B
TypeScript
21 lines
805 B
TypeScript
/**
|
|
* Whether the app is locked, for everything that would show mail outside the app.
|
|
*
|
|
* lib/app-lock/controller.ts calls setAppLockCheck once, at the start of each page, with
|
|
* a function that answers from its own state, and calls bridge.os.setLocked(true) when it
|
|
* locks. components/desktop/desktop-os-host.tsx says it's open again when the app starts
|
|
* behind the lock. Main then clears the tray, the jump list and delivered toasts, and strips
|
|
* anything that still comes through. Main keeps its own answer too (the shell's
|
|
* app-lock-gate.ts), which stands over what any page says.
|
|
*/
|
|
|
|
let check: (() => boolean) | null = null;
|
|
|
|
export function setAppLockCheck(next: (() => boolean) | null): void {
|
|
check = next;
|
|
}
|
|
|
|
export function isAppLocked(): boolean {
|
|
return check?.() === true;
|
|
}
|