feat(desktop): open system in default browser via opener plugin (fallback to in-webview) to avoid localhost navigation issues
This commit is contained in:
parent
ae6beeb4c9
commit
cf45e36f32
1 changed files with 8 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { invoke } from "@tauri-apps/api/core"
|
import { invoke } from "@tauri-apps/api/core"
|
||||||
import { Store } from "@tauri-apps/plugin-store"
|
import { Store } from "@tauri-apps/plugin-store"
|
||||||
|
import { open as openExternal } from "@tauri-apps/plugin-opener"
|
||||||
|
|
||||||
type MachineOs = {
|
type MachineOs = {
|
||||||
name: string
|
name: string
|
||||||
|
|
@ -698,8 +699,14 @@ function redirectToApp(config: AgentConfig) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const url = `${config.appUrl}/machines/handshake?token=${encodeURIComponent(token)}`
|
const url = `${config.appUrl}/machines/handshake?token=${encodeURIComponent(token)}`
|
||||||
|
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)
|
window.location.replace(url)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
void perform()
|
void perform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue