chore(desktop): drop debug console.logs from launch-mode reset flow
The console.log breadcrumbs added while diagnosing the menu also caused an uncaught "write EPIPE" when the parent terminal pipe was already closed by the time the user clicked Change Launch Mode. Now that the flow is verified working, remove the chatter and keep only the actual error-path logging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,11 +12,7 @@ type Phase =
|
||||
|
||||
function getFusionShell() {
|
||||
if (typeof window === "undefined") return null;
|
||||
const shell = window.fusionShell ?? null;
|
||||
if (!shell) {
|
||||
console.log("[DesktopLaunchGate] window.fusionShell unavailable; bypassing");
|
||||
}
|
||||
return shell;
|
||||
return window.fusionShell ?? null;
|
||||
}
|
||||
|
||||
function isDesktopShell(state: ShellConnectionState | null): boolean {
|
||||
@@ -77,19 +73,15 @@ export function DesktopLaunchGate({ children }: PropsWithChildren) {
|
||||
let cancelled = false;
|
||||
void (async () => {
|
||||
try {
|
||||
console.log("[DesktopLaunchGate] fetching shell state…");
|
||||
const state = await shell.getState();
|
||||
if (cancelled) return;
|
||||
console.log("[DesktopLaunchGate] shell state:", state);
|
||||
|
||||
if (!isDesktopShell(state)) {
|
||||
console.log("[DesktopLaunchGate] not desktop-shell host; bypassing");
|
||||
setPhase({ kind: "bypass" });
|
||||
return;
|
||||
}
|
||||
|
||||
if (needsChooser(state)) {
|
||||
console.log("[DesktopLaunchGate] first run / no mode chosen — showing chooser");
|
||||
setPhase({ kind: "chooser", state });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ export function getCurrentDesktopLaunchMode(): DesktopLaunchMode {
|
||||
}
|
||||
|
||||
async function resetLaunchModeAndReload(window: BrowserWindow): Promise<void> {
|
||||
console.log("[desktop/main] resetLaunchModeAndReload start");
|
||||
try {
|
||||
const settings = await readShellSettings();
|
||||
settings.desktopMode = null;
|
||||
@@ -96,13 +95,10 @@ async function resetLaunchModeAndReload(window: BrowserWindow): Promise<void> {
|
||||
// serverBaseUrl / shellMode query params so the gate re-prompts.
|
||||
try {
|
||||
if (isUrlRenderer()) {
|
||||
console.log("[desktop/main] reloading URL renderer", getRendererUrl());
|
||||
await window.loadURL(getRendererUrl());
|
||||
} else {
|
||||
console.log("[desktop/main] reloading file renderer", getRendererFilePath());
|
||||
await window.loadFile(getRendererFilePath());
|
||||
}
|
||||
console.log("[desktop/main] resetLaunchModeAndReload complete");
|
||||
} catch (error) {
|
||||
console.error("[desktop/main] reload failed", error);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,7 @@ function buildConnectionSubmenu(options: AppMenuOptions): MenuItemConstructorOpt
|
||||
{
|
||||
label: "Change Launch Mode…",
|
||||
click: () => {
|
||||
console.log("[desktop/menu] Change Launch Mode clicked");
|
||||
if (!options.onChangeLaunchMode) {
|
||||
console.warn("[desktop/menu] onChangeLaunchMode callback not provided");
|
||||
return;
|
||||
}
|
||||
if (!options.onChangeLaunchMode) return;
|
||||
void Promise.resolve(options.onChangeLaunchMode()).catch((error: unknown) => {
|
||||
console.error("[desktop/menu] onChangeLaunchMode failed", error);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user