MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / showExecutor

Function showExecutor

projects/electron/src/executor.ts:236–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234}
235
236const showExecutor = async () => {
237 try {
238 let win = currentExecutor().window
239 if (!win) {
240 // For some reason handing off to the async loop in electron can fucking take a long assss time
241 // like 400ms to 3.6s in some cases, its wack and makes no sense.... even if the async func returns immediately
242 // so we only really do this when we need to (the window is dead).
243 await waitFor(() => currentExecutor().window !== null, 50, 10000)
244 }
245 win = currentExecutor().window
246 if (!win) {
247 // unlikely
248 return
249 }
250 if (process.platform === "win32") {
251 win.setAlwaysOnTop(true)
252 win.show()
253 win.setAlwaysOnTop(false)
254 app.focus()
255 } else {
256 win.show()
257 win.focus()
258 }
259 return
260 } catch (e) {
261 logger.warn("unable to wait for the window in time")
262 return
263 }
264}
265
266export const load = () => {
267 app.on("ready", () => {

Callers 1

startExecutorFunction · 0.85

Calls 2

waitForFunction · 0.90
currentExecutorFunction · 0.85

Tested by

no test coverage detected