From 3230582842e368cd2fae816b9a2c8b83579b42cc Mon Sep 17 00:00:00 2001 From: didirus4 Date: Sat, 28 Dec 2024 20:23:57 +0300 Subject: [PATCH] Possible fix updater again with async --- apps/app-frontend/src/helpers/update.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/app-frontend/src/helpers/update.js b/apps/app-frontend/src/helpers/update.js index f12afc42f..4bf3e4629 100644 --- a/apps/app-frontend/src/helpers/update.js +++ b/apps/app-frontend/src/helpers/update.js @@ -11,11 +11,9 @@ export const latestBetaCommitLink = ref('') export const launcherUrl = 'https://www.astralium.su/get/ar' const os = ref('') -const version = await getVersion() const releaseLink = `https://api.github.com/repos/DIDIRUS4/AstralRinth/releases/latest` const branchesLink = `https://api.github.com/repos/DIDIRUS4/AstralRinth/branches` const failedFetch = [`Failed to fetch remote releases:`, `Failed to fetch remote commits:`] -const localVersion = `v${version}` const betaBranch = `beta` // Github repository beta branch const osNames = ['macos', 'windows', 'linux'] const macExtension = `.dmg` // MacOS file type for download @@ -99,8 +97,9 @@ export async function getRemote(elementIdBool, downloadArtifactBool) { } else { remoteVersion = latestRelease } + console.log(await getVersion()) if (osNames.includes(os.value.toLowerCase())) { - if (remoteVersion.startsWith(localVersion)) { + if (remoteVersion.startsWith('v' + await getVersion())) { updateState.value = false allowState.value = false } else { @@ -113,7 +112,7 @@ export async function getRemote(elementIdBool, downloadArtifactBool) { } console.log('Update available state is', updateState.value) console.log('Remote version is', remoteVersion) - console.log('Local version is', localVersion) + console.log('Local version is', await getVersion()) console.log('Operating System is', os.value) if (downloadArtifactBool) {