Skip to content

Commit

Permalink
feat(projects): does the configuration support automatic updates. clo…
Browse files Browse the repository at this point in the history
…se#612 (#617)
  • Loading branch information
Azir-11 committed Sep 3, 2024
1 parent 9c012c7 commit 4c9f4e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ VITE_SOURCE_MAP=N

# Used to differentiate storage across different domains
VITE_STORAGE_PREFIX=SOY_

# used to control whether the program automatically detects updates
VITE_AUTOMATICALLY_DETECT_UPDATE=Y
6 changes: 5 additions & 1 deletion src/plugins/app.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { h } from 'vue';
import { NButton } from 'naive-ui';
import { $t } from '../locales';
import { $t } from '@/locales';

export function setupAppVersionNotification() {
const canAutoUpdateApp = import.meta.env.VITE_AUTOMATICALLY_DETECT_UPDATE === 'Y';

if (!canAutoUpdateApp) return;

let isShow = false;

document.addEventListener('visibilitychange', async () => {
Expand Down
2 changes: 2 additions & 0 deletions src/typings/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ declare namespace Env {
readonly VITE_ICONIFY_URL?: string;
/** Used to differentiate storage across different domains */
readonly VITE_STORAGE_PREFIX?: string;
/** Whether to automatically detect updates after configuring application packaging */
readonly VITE_AUTOMATICALLY_DETECT_UPDATE?: CommonType.YesOrNo;
}
}

Expand Down

0 comments on commit 4c9f4e0

Please sign in to comment.