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
*/
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 {
// @ts-ignore
const { open } = await import('@tauri-apps/plugin-shell');
await open(url);
return;