chore: able to disable updater via env flag

This commit is contained in:
Louis 2025-08-03 23:32:27 +07:00
parent 90e46a2696
commit b8070f1871
3 changed files with 15 additions and 6 deletions

View File

@ -62,7 +62,12 @@ export function DataProvider() {
// Check for app updates // Check for app updates
useEffect(() => { useEffect(() => {
// Only check for updates if the auto updater is not disabled
// App might be distributed via other package managers
// or methods that handle updates differently
if (!AUTO_UPDATER_DISABLED) {
checkForUpdate() checkForUpdate()
}
}, [checkForUpdate]) }, [checkForUpdate])
const handleDeepLink = (urls: string[] | null) => { const handleDeepLink = (urls: string[] | null) => {

View File

@ -19,6 +19,7 @@ declare global {
declare const POSTHOG_KEY: string declare const POSTHOG_KEY: string
declare const POSTHOG_HOST: string declare const POSTHOG_HOST: string
declare const MODEL_CATALOG_URL: string declare const MODEL_CATALOG_URL: string
declare const AUTO_UPDATER_DISABLED: boolean
interface Window { interface Window {
core: AppCore | undefined core: AppCore | undefined
} }

View File

@ -33,19 +33,19 @@ export default defineConfig(({ mode }) => {
define: { define: {
IS_TAURI: JSON.stringify(process.env.IS_TAURI), IS_TAURI: JSON.stringify(process.env.IS_TAURI),
IS_MACOS: JSON.stringify( IS_MACOS: JSON.stringify(
process.env.TAURI_ENV_PLATFORM?.includes('darwin') ?? 'false' process.env.TAURI_ENV_PLATFORM?.includes('darwin') ?? false
), ),
IS_WINDOWS: JSON.stringify( IS_WINDOWS: JSON.stringify(
process.env.TAURI_ENV_PLATFORM?.includes('windows') ?? 'false' process.env.TAURI_ENV_PLATFORM?.includes('windows') ?? false
), ),
IS_LINUX: JSON.stringify( IS_LINUX: JSON.stringify(
process.env.TAURI_ENV_PLATFORM?.includes('linux') ?? 'false' process.env.TAURI_ENV_PLATFORM?.includes('linux') ?? false
), ),
IS_IOS: JSON.stringify( IS_IOS: JSON.stringify(
process.env.TAURI_ENV_PLATFORM?.includes('ios') ?? 'false' process.env.TAURI_ENV_PLATFORM?.includes('ios') ?? false
), ),
IS_ANDROID: JSON.stringify( IS_ANDROID: JSON.stringify(
process.env.TAURI_ENV_PLATFORM?.includes('android') ?? 'false' process.env.TAURI_ENV_PLATFORM?.includes('android') ?? false
), ),
PLATFORM: JSON.stringify(process.env.TAURI_ENV_PLATFORM), PLATFORM: JSON.stringify(process.env.TAURI_ENV_PLATFORM),
@ -56,6 +56,9 @@ export default defineConfig(({ mode }) => {
MODEL_CATALOG_URL: JSON.stringify( MODEL_CATALOG_URL: JSON.stringify(
'https://raw.githubusercontent.com/menloresearch/model-catalog/main/model_catalog.json' 'https://raw.githubusercontent.com/menloresearch/model-catalog/main/model_catalog.json'
), ),
AUTO_UPDATER_DISABLED: JSON.stringify(
env.AUTO_UPDATER_DISABLED === 'true'
),
}, },
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`