From cf45e36f32c2417fd3772d665d4c8b29afef0fd3 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Fri, 10 Oct 2025 00:49:02 -0300 Subject: [PATCH] feat(desktop): open system in default browser via opener plugin (fallback to in-webview) to avoid localhost navigation issues --- apps/desktop/src/main.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index e86665e..c426076 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -1,5 +1,6 @@ import { invoke } from "@tauri-apps/api/core" import { Store } from "@tauri-apps/plugin-store" +import { open as openExternal } from "@tauri-apps/plugin-opener" type MachineOs = { name: string @@ -698,7 +699,13 @@ function redirectToApp(config: AgentConfig) { return } const url = `${config.appUrl}/machines/handshake?token=${encodeURIComponent(token)}` - window.location.replace(url) + try { + await openExternal(url) + setAlert("Abrindo o Sistema de Chamados no navegador padrão…", "success") + } catch { + // fallback: navegar dentro da WebView + window.location.replace(url) + } } void perform() }