MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / persistWindowState

Function persistWindowState

apps/desktop/src/main/index.ts:891–905  ·  view source on GitHub ↗
(win: BrowserWindow)

Source from the content-addressed store, hash-verified

889}
890
891async 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
907interface CreateWindowOptions {
908 initialVaultRoot?: string | null

Callers 2

flushWindowStatePersistFunction · 0.85

Calls 1

updateConfigFunction · 0.90

Tested by

no test coverage detected