Skip to content

Commit

Permalink
feat(projects): does the configuration support automatic updates
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Sep 8, 2024
1 parent 5a020dd commit ffe4cef
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 @@ -43,3 +43,6 @@ VITE_STATIC_SUPER_ROLE=R_SUPER

# 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 { Button } from 'ant-design-vue';
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 ffe4cef

Please sign in to comment.