()
| 41 | } |
| 42 | |
| 43 | focusMainWindow(): void { |
| 44 | const mainWindow = this.mainWindow; |
| 45 | if (!mainWindow) { |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | const isDestroyed = |
| 50 | typeof (mainWindow as { isDestroyed?: () => boolean }).isDestroyed === "function" |
| 51 | ? (mainWindow as { isDestroyed: () => boolean }).isDestroyed() |
| 52 | : false; |
| 53 | |
| 54 | if (isDestroyed) { |
| 55 | return; |
| 56 | } |
| 57 | |
| 58 | try { |
| 59 | if ( |
| 60 | typeof (mainWindow as { isMinimized?: () => boolean }).isMinimized === "function" && |
| 61 | (mainWindow as { isMinimized: () => boolean }).isMinimized() && |
| 62 | typeof (mainWindow as { restore?: () => void }).restore === "function" |
| 63 | ) { |
| 64 | (mainWindow as { restore: () => void }).restore(); |
| 65 | } |
| 66 | |
| 67 | if (typeof (mainWindow as { show?: () => void }).show === "function") { |
| 68 | (mainWindow as { show: () => void }).show(); |
| 69 | } |
| 70 | |
| 71 | if (typeof (mainWindow as { focus?: () => void }).focus === "function") { |
| 72 | (mainWindow as { focus: () => void }).focus(); |
| 73 | } |
| 74 | } catch (error) { |
| 75 | log.debug("WindowService: focusMainWindow failed", error); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | send(channel: string, ...args: unknown[]): void { |
| 80 | const isDestroyed = |
no test coverage detected