fix: improve Tauri shell import logic in openExternalUrl function
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user