(win: BrowserWindow)
| 889 | } |
| 890 | |
| 891 | async function persistWindowState(win: BrowserWindow): Promise<void> { |
| 892 | if (win.isDestroyed()) return |
| 893 | const isMaximized = win.isMaximized() |
| 894 | const bounds = isMaximized ? win.getNormalBounds() : win.getBounds() |
| 895 | await updateConfig((cfg) => ({ |
| 896 | ...cfg, |
| 897 | windowState: { |
| 898 | x: bounds.x, |
| 899 | y: bounds.y, |
| 900 | width: bounds.width, |
| 901 | height: bounds.height, |
| 902 | isMaximized |
| 903 | } |
| 904 | })) |
| 905 | } |
| 906 | |
| 907 | interface CreateWindowOptions { |
| 908 | initialVaultRoot?: string | null |
no test coverage detected