Spaces:
Paused
Paused
Download console/src/tauri/closeWindowPreference.ts from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 678 Bytes
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/tauri/closeWindowPreference.ts
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/tauri/closeWindowPreference.ts
-
curl -L -o closeWindowPreference.ts https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/tauri/closeWindowPreference.ts
678 Bytes
| export const CLOSE_ACTION_STORAGE_KEY = "qwenpaw.closeWindowAction"; | |
| export type CloseAction = "minimize-to-tray" | "quit"; | |
| export function getRememberedCloseAction(): CloseAction | null { | |
| const action = getStorage()?.getItem(CLOSE_ACTION_STORAGE_KEY); | |
| return action === "minimize-to-tray" || action === "quit" ? action : null; | |
| } | |
| export function setRememberedCloseAction(action: CloseAction) { | |
| getStorage()?.setItem(CLOSE_ACTION_STORAGE_KEY, action); | |
| } | |
| export function clearRememberedCloseAction() { | |
| getStorage()?.removeItem(CLOSE_ACTION_STORAGE_KEY); | |
| } | |
| function getStorage(): Storage | null { | |
| return typeof window === "undefined" ? null : window.localStorage; | |
| } | |