1FeaturesAccessing self-hosted instances via the official Fluxer apps (#1223) Feature Shipped desktop self-hosting3mo agoby RexSystem edited originally by @davefatkin on GitHubThreadView full discussion Comment by @WatchCollector67RexSystem 1 vote 3mo ago originally by @WatchCollector67 on GitHub It already is possible, you can switch instances via the Account Switcher menu, although it is currently broken. I was able to patch a quick fix and get it working. Patch: diff --git a/fluxer_desktop/src/main/IpcHandlers.ts b/fluxer_desktop/src/main/IpcHandlers.ts index 62bac2c269..0000000000 100644 --- a/fluxer_desktop/src/main/IpcHandlers.ts +++ b/fluxer_desktop/src/main/IpcHandlers.ts @@ -151,6 +151,14 @@ async function assertValidFluxerInstance(instanceOrigin: string): Promise<void> { } } +function getElectronLoadErrorCode(error: unknown): number | null { + const message = error instanceof Error ? error.message : String(error); + const match = /\(([-\d]+)\)/.exec(message); + if (!match) return null; + const value = Number.parseInt(match[1], 10); + return Number.isFinite(value) ? value : null; +} + export function registerIpcHandlers(): void { registerVoiceDebugEventSinkPopoutIpcHandlers(); registerVoiceBackgroundMediaCacheHandlers(); @@ -168,6 +176,10 @@ export function registerIpcHandlers(): void { try { await mainWindow.loadURL(instanceOrigin); } catch (error) { + if (getElectronLoadErrorCode(error) === -3) { + return; + } + setCustomAppUrl(null); pendingDesktopHandoffCode = null; const detail = error instanceof Error ? error.message : String(error); Permalink
Comment by @WatchCollector67RexSystem 1 vote 3mo ago originally by @WatchCollector67 on GitHub It already is possible, you can switch instances via the Account Switcher menu, although it is currently broken. I was able to patch a quick fix and get it working. Patch: diff --git a/fluxer_desktop/src/main/IpcHandlers.ts b/fluxer_desktop/src/main/IpcHandlers.ts index 62bac2c269..0000000000 100644 --- a/fluxer_desktop/src/main/IpcHandlers.ts +++ b/fluxer_desktop/src/main/IpcHandlers.ts @@ -151,6 +151,14 @@ async function assertValidFluxerInstance(instanceOrigin: string): Promise<void> { } } +function getElectronLoadErrorCode(error: unknown): number | null { + const message = error instanceof Error ? error.message : String(error); + const match = /\(([-\d]+)\)/.exec(message); + if (!match) return null; + const value = Number.parseInt(match[1], 10); + return Number.isFinite(value) ? value : null; +} + export function registerIpcHandlers(): void { registerVoiceDebugEventSinkPopoutIpcHandlers(); registerVoiceBackgroundMediaCacheHandlers(); @@ -168,6 +176,10 @@ export function registerIpcHandlers(): void { try { await mainWindow.loadURL(instanceOrigin); } catch (error) { + if (getElectronLoadErrorCode(error) === -3) { + return; + } + setCustomAppUrl(null); pendingDesktopHandoffCode = null; const detail = error instanceof Error ? error.message : String(error); Permalink
Thread
Comment by @WatchCollector67