()
| 234 | } |
| 235 | |
| 236 | const 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 | |
| 266 | export const load = () => { |
| 267 | app.on("ready", () => { |
no test coverage detected