mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Fix updater
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
{{ t('dialog.vrcx_updater.cancel') }}
|
{{ t('dialog.vrcx_updater.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="Boolean(VRCXUpdateDialog.release) !== pendingVRCXInstall"
|
v-if="VRCXUpdateDialog.release !== pendingVRCXInstall"
|
||||||
:disabled="updateInProgress"
|
:disabled="updateInProgress"
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import configRepository from '../service/config';
|
|||||||
import { watchState } from '../service/watchState';
|
import { watchState } from '../service/watchState';
|
||||||
import { branches } from '../shared/constants';
|
import { branches } from '../shared/constants';
|
||||||
import { changeLogRemoveLinks } from '../shared/utils';
|
import { changeLogRemoveLinks } from '../shared/utils';
|
||||||
import { useAuthStore } from './auth';
|
|
||||||
import { useUiStore } from './ui';
|
import { useUiStore } from './ui';
|
||||||
import { useI18n } from 'vue-i18n-bridge';
|
import { useI18n } from 'vue-i18n-bridge';
|
||||||
import { AppGlobal } from '../service/appConfig';
|
import { AppGlobal } from '../service/appConfig';
|
||||||
@@ -27,8 +26,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
updatePending: false,
|
updatePending: false,
|
||||||
updatePendingIsLatest: false,
|
updatePendingIsLatest: false,
|
||||||
release: '',
|
release: '',
|
||||||
releases: [],
|
releases: []
|
||||||
json: {}
|
|
||||||
},
|
},
|
||||||
changeLogDialog: {
|
changeLogDialog: {
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -36,7 +34,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
changeLog: ''
|
changeLog: ''
|
||||||
},
|
},
|
||||||
pendingVRCXUpdate: false,
|
pendingVRCXUpdate: false,
|
||||||
pendingVRCXInstall: false,
|
pendingVRCXInstall: '',
|
||||||
|
|
||||||
updateInProgress: false,
|
updateInProgress: false,
|
||||||
updateProgress: 0
|
updateProgress: 0
|
||||||
@@ -181,7 +179,6 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function checkForVRCXUpdate() {
|
async function checkForVRCXUpdate() {
|
||||||
const authStore = useAuthStore();
|
|
||||||
if (
|
if (
|
||||||
!currentVersion.value ||
|
!currentVersion.value ||
|
||||||
currentVersion.value === 'VRCX Nightly Build' ||
|
currentVersion.value === 'VRCX Nightly Build' ||
|
||||||
@@ -218,7 +215,6 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
console.log(json, response);
|
console.log(json, response);
|
||||||
}
|
}
|
||||||
if (json === Object(json) && json.name && json.published_at) {
|
if (json === Object(json) && json.name && json.published_at) {
|
||||||
state.VRCXUpdateDialog.updateJson = json;
|
|
||||||
state.changeLogDialog.buildName = json.name;
|
state.changeLogDialog.buildName = json.name;
|
||||||
state.changeLogDialog.changeLog = changeLogRemoveLinks(json.body);
|
state.changeLogDialog.changeLog = changeLogRemoveLinks(json.body);
|
||||||
const releaseName = json.name;
|
const releaseName = json.name;
|
||||||
@@ -227,7 +223,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
if (releaseName === state.pendingVRCXInstall) {
|
if (releaseName === state.pendingVRCXInstall) {
|
||||||
// update already downloaded
|
// update already downloaded
|
||||||
state.VRCXUpdateDialog.updatePendingIsLatest = true;
|
state.VRCXUpdateDialog.updatePendingIsLatest = true;
|
||||||
} else if (releaseName > state.currentVersion) {
|
} else if (releaseName > currentVersion.value) {
|
||||||
let downloadUrl = '';
|
let downloadUrl = '';
|
||||||
let downloadName = '';
|
let downloadName = '';
|
||||||
let hashUrl = '';
|
let hashUrl = '';
|
||||||
@@ -270,9 +266,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
state.pendingVRCXUpdate = true;
|
state.pendingVRCXUpdate = true;
|
||||||
uiStore.notifyMenu('settings');
|
uiStore.notifyMenu('settings');
|
||||||
const type = 'Auto';
|
const type = 'Auto';
|
||||||
if (!watchState.isLoggedIn) {
|
if (state.autoUpdateVRCX === 'Notify') {
|
||||||
showVRCXUpdateDialog();
|
|
||||||
} else if (state.autoUpdateVRCX === 'Notify') {
|
|
||||||
// this.showVRCXUpdateDialog();
|
// this.showVRCXUpdateDialog();
|
||||||
} else if (state.autoUpdateVRCX === 'Auto Download') {
|
} else if (state.autoUpdateVRCX === 'Auto Download') {
|
||||||
await downloadVRCXUpdate(
|
await downloadVRCXUpdate(
|
||||||
@@ -292,6 +286,9 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
|
|||||||
D.visible = true;
|
D.visible = true;
|
||||||
D.updatePendingIsLatest = false;
|
D.updatePendingIsLatest = false;
|
||||||
D.updatePending = await AppApi.CheckForUpdateExe();
|
D.updatePending = await AppApi.CheckForUpdateExe();
|
||||||
|
if (state.updateInProgress) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await loadBranchVersions();
|
await loadBranchVersions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user