fix: improve Tauri shell import logic in openExternalUrl function

This commit is contained in:
2026-01-24 08:04:09 +11:00
parent a6b76a9be7
commit a2268f863b

View File

@@ -3,8 +3,10 @@
* @param url The URL to open * @param url The URL to open
*/ */
export const openExternalUrl = async (url: string): Promise<void> => { export const openExternalUrl = async (url: string): Promise<void> => {
if (isTauri()) { // Only try to import Tauri shell in Tauri builds
if (typeof window !== 'undefined' && (window as any).__TAURI__) {
try { try {
// @ts-ignore
const { open } = await import('@tauri-apps/plugin-shell'); const { open } = await import('@tauri-apps/plugin-shell');
await open(url); await open(url);
return; return;