(win: BrowserWindow, id: string)
| 212 | } |
| 213 | |
| 214 | function registerWindow(win: BrowserWindow, id: string) { |
| 215 | windowIDs.set(win, id) |
| 216 | windowsByID.set(id, win) |
| 217 | persistWindowID(id) |
| 218 | |
| 219 | win.on("focus", () => { |
| 220 | lastFocusedWindowID = id |
| 221 | }) |
| 222 | win.on("closed", () => { |
| 223 | windowsByID.delete(id) |
| 224 | if (lastFocusedWindowID === id) lastFocusedWindowID = windowsByID.keys().next().value |
| 225 | if (!appQuitting) removeWindowID(id) |
| 226 | }) |
| 227 | } |
| 228 | |
| 229 | function readWindowIDs() { |
| 230 | const value = getStore().get(WINDOW_IDS_KEY) |
no test coverage detected