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

Method focusChatOwner

src/main/windows/window-manager.ts:191–204  ·  view source on GitHub ↗

* Focus the window that owns a given chatId. * Returns true if the window was found and focused.

(chatId: string)

Source from the content-addressed store, hash-verified

189 * Returns true if the window was found and focused.
190 */
191 focusChatOwner(chatId: string): boolean {
192 const ownerId = this.chatOwnership.get(chatId)
193 if (ownerId === undefined) return false
194
195 const window = this.windows.get(ownerId)
196 if (!window || window.isDestroyed()) {
197 this.chatOwnership.delete(chatId)
198 return false
199 }
200
201 if (window.isMinimized()) window.restore()
202 window.focus()
203 return true
204 }
205
206 /**
207 * Get the electron window ID that owns a chat, if any.

Callers 2

AgentsSidebarFunction · 0.80
registerIpcHandlersFunction · 0.80

Calls 2

getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected