From bb6604e81995b3c4a9b06717e21b8d0dff58a488 Mon Sep 17 00:00:00 2001 From: Max Litruv Boonzaayer Date: Fri, 20 Feb 2026 01:39:37 +1100 Subject: [PATCH] feat(updater): refactor update check to ensure it only runs in Tauri context --- src/index.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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) {