MCPcopy Index your code
hub / github.com/21st-dev/1code / getWindowFromEvent

Function getWindowFromEvent

src/main/windows/main.ts:32–38  ·  view source on GitHub ↗
(
  event: Electron.IpcMainInvokeEvent,
)

Source from the content-addressed store, hash-verified

30
31// Helper to get window from IPC event
32function getWindowFromEvent(
33 event: Electron.IpcMainInvokeEvent,
34): BrowserWindow | null {
35 const webContents = event.sender
36 const win = BrowserWindow.fromWebContents(webContents)
37 return win && !win.isDestroyed() ? win : null
38}
39
40// Register IPC handlers for window operations (only once)
41let ipcHandlersRegistered = false

Callers 1

registerIpcHandlersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected