diff --git a/src/index.tsx b/src/index.tsx index f0c9ab1..7011f3a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -12,10 +12,7 @@ import './index.css'; import { trimTrailingSlash } from './app/utils/common'; import App from './app/pages/App'; -import { applySafeAreaInsets } from './app/utils/tauri'; -import { check } from '@tauri-apps/plugin-updater'; -import { ask } from '@tauri-apps/plugin-dialog'; -import { relaunch } from '@tauri-apps/plugin-process'; +import { applySafeAreaInsets, isTauri } from './app/utils/tauri'; // import i18n (needs to be bundled ;)) import './app/i18n'; @@ -50,8 +47,18 @@ if ('serviceWorker' in navigator) { * Prompts user if update is available and handles download/install */ async function checkForUpdates() { + // Only run in Tauri context + if (!isTauri()) { + console.log('Update check skipped - not running in Tauri'); + return; + } + console.log('Checking for updates...'); try { + const { check } = await import('@tauri-apps/plugin-updater'); + const { ask } = await import('@tauri-apps/plugin-dialog'); + const { relaunch } = await import('@tauri-apps/plugin-process'); + const update = await check(); console.log('Update check result:', update); if (update) {