INNER CODE UNIT · TypeScript
Promise
SimonAKing/scrcpy-gui · src/main/main.ts:1068
return new Promise((settle) => {
const timer = setTimeout(settle, SHUTDOWN_TIMEOUT_MS)
void task.finally(() => {
clearTimeout(timer)
settle()
})
})
}
function beginShutdown(): Promise<void> {
if (shutdownPromise) return shutdownPromise
isQuitting = true
globalShortcut.unregisterAll()
batchAutomationService.stopAll()
stopAllScrcpy()
stopDeviceTracker()
// Hide the window the moment quitting starts. Shutdown waits for ADB, and leaving the
// window on screen made quitting from the tray look like nothing had happened, so people