Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): a stuck quit no longer leaves the app unkillable #23873

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/23873/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 115 additions and 18 deletions.

x
0 of 2 viewed, 2 left
57 additions and 1 deletionapps/desktop/src/app/DesktopLifecycle.test.tsModified
View file
@@ -3,6 +3,7 @@
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Ref from "effect/Ref";
+import * as TestClock from "effect/testing/TestClock";
​
import type * as Electron from "electron";
​
@@ -18,6 +19,7 @@
function layerElectronApp(
appListeners: Map<string, (...args: readonly unknown[]) => void>,
quit: Effect.Effect<void> = Effect.void,
+ exit: (code: number) => Effect.Effect<void> = () => Effect.void,
) {
const registerListener = (eventName: string, listener: (...args: readonly unknown[]) => void) =>
Effect.acquireRelease(
@@ -37,7 +39,7 @@
whenReady: Effect.void,
requestSingleInstanceLock: Effect.succeed(true),
quit,
- exit: () => Effect.void,
+ exit,
relaunch: () => Effect.void,
setPath: () => Effect.void,
setName: () => Effect.void,
@@ -221,6 +223,60 @@
}),