Skip to content

Commit

Permalink
Possible fix updater again with async
Browse files Browse the repository at this point in the history
  • Loading branch information
DIDIRUS4 committed Dec 28, 2024
1 parent 10c1066 commit 3230582
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/app-frontend/src/helpers/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down

0 comments on commit 3230582

Please sign in to comment.