feat(desktop): stop the daemon when you quit the app (#2454)
Quitting the desktop app now shuts down the daemon it started, so "restart the app" is a complete reset users can act on without first learning what a daemon is. The old default kept it alive; the toggle under Settings > Host still opts back in. Existing installs already persisted `keepRunningAfterQuit: true` from the old default, so a new default alone would only reach fresh installs. A one-time migration resets it, and an explicit toggle afterwards persists the migration flag and is never overridden again. Only a desktop-managed daemon is stopped — one started with `paseo daemon start` is left alone.
This commit is contained in:
@@ -7,12 +7,12 @@ import {
|
||||
stopDesktopManagedDaemonOnQuitIfNeeded,
|
||||
} from "./quit-lifecycle";
|
||||
|
||||
const SETTINGS_KEEP_RUNNING = DEFAULT_DESKTOP_SETTINGS;
|
||||
const SETTINGS_STOP_ON_QUIT = {
|
||||
const SETTINGS_STOP_ON_QUIT = DEFAULT_DESKTOP_SETTINGS;
|
||||
const SETTINGS_KEEP_RUNNING = {
|
||||
...DEFAULT_DESKTOP_SETTINGS,
|
||||
daemon: {
|
||||
...DEFAULT_DESKTOP_SETTINGS.daemon,
|
||||
keepRunningAfterQuit: false,
|
||||
keepRunningAfterQuit: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ function waitForQuitLifecycle(): Promise<void> {
|
||||
}
|
||||
|
||||
describe("quit-lifecycle", () => {
|
||||
it("only stops when keepRunningAfterQuit is explicitly disabled", () => {
|
||||
it("stops by default and only keeps running when keepRunningAfterQuit is enabled", () => {
|
||||
expect(shouldStopDesktopManagedDaemonOnQuit(SETTINGS_STOP_ON_QUIT)).toBe(true);
|
||||
expect(shouldStopDesktopManagedDaemonOnQuit(SETTINGS_KEEP_RUNNING)).toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user