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

Method handleToggleWindow

src/main/core/httpServer.ts:248–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246 }
247
248 private handleToggleWindow(): ApiResponse {
249 try {
250 const mainWindow = windowManager.getMainWindow()
251 if (mainWindow?.isVisible()) {
252 windowManager.hideWindow(false)
253 } else {
254 windowManager.showWindow()
255 }
256 return { code: 0, message: '操作成功' }
257 } catch (error) {
258 return {
259 code: 500,
260 message: error instanceof Error ? error.message : '切换窗口失败'
261 }
262 }
263 }
264}
265
266export default new HttpServer()

Callers 1

routeRequestMethod · 0.95

Calls 3

getMainWindowMethod · 0.80
hideWindowMethod · 0.45
showWindowMethod · 0.45

Tested by

no test coverage detected