MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / loadLastWindowSize

Function loadLastWindowSize

projects/electron/src/executor.ts:76–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76const loadLastWindowSize = (): Rectangle => {
77 try {
78 const res = store.get(windowSizeStorageKey) as Rectangle | null
79 if (res && res.height > 50 && res.width > 50) {
80 if (isWindowVisibleOnAnyDisplay(res)) {
81 return res
82 }
83 // Position is off-screen (e.g., monitor disconnected) but size is valid.
84 // Keep user's preferred dimensions, reset position to a visible display.
85 const fallback = defaultExecutorBounds()
86 return { x: fallback.x, y: fallback.y, width: res.width, height: res.height }
87 }
88 } catch (e) {
89 // pass
90 }
91 return defaultExecutorBounds()
92}
93
94const saveWindowSize = debounce(
95 (bounds: Rectangle) => {

Callers 1

startExecutorFunction · 0.85

Calls 3

defaultExecutorBoundsFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected