MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / handleShowWindow

Method handleShowWindow

src/main/core/httpServer.ts:215–234  ·  view source on GitHub ↗
(body: Record<string, unknown>)

Source from the content-addressed store, hash-verified

213 }
214
215 private handleShowWindow(body: Record<string, unknown>): ApiResponse {
216 try {
217 windowManager.showWindow()
218
219 const text = typeof body.text === 'string' ? body.text : undefined
220 if (text !== undefined) {
221 const mainWindow = windowManager.getMainWindow()
222 setTimeout(() => {
223 mainWindow?.webContents.send('set-search-text', text)
224 }, 100)
225 }
226
227 return { code: 0, message: '操作成功' }
228 } catch (error) {
229 return {
230 code: 500,
231 message: error instanceof Error ? error.message : '显示窗口失败'
232 }
233 }
234 }
235
236 private handleHideWindow(): ApiResponse {
237 try {

Callers 1

routeRequestMethod · 0.95

Calls 2

getMainWindowMethod · 0.80
showWindowMethod · 0.45

Tested by

no test coverage detected