Skip to content

Commit

Permalink
Mobile app - Fix updates
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Nov 16, 2024
1 parent eda61e6 commit 4477196
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ dist
# React build output
build/

cordova/
cordova/
src/app/default_cfg.js
27 changes: 0 additions & 27 deletions src/app/default_cfg.js

This file was deleted.

9 changes: 7 additions & 2 deletions src/utils/app/UpdateUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ export async function checkUpdates(timeout = 2000) {
if (versions[0]) {
const [ v, obj ] = versions[0]
if (obj.exe) {
let exeLink = new URL(obj.exe_url, updaterHost()).toString()
if (!isDesktop) {
exeLink = new URL('/api/html/' + path + '/' + v, updaterHost())
exeLink = exeLink.toString()
}
return {
version: v,
exe: obj.exe,
exeLink: new URL(obj.exe_url, updaterHost()).toString(),
exeLink,
txt: obj.txt,
txtLink: new URL(obj.txt_url, updaterHost()).toString(),
title: tt('app_update.notify_VERSION', { VERSION: v }),
Expand All @@ -84,6 +89,6 @@ export async function getChangelog(txtLink) {
return res
} catch (err) {
console.error('getChangelog', err)
return ''
throw err
}
}
1 change: 1 addition & 0 deletions src/utils/initConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const loadMobileConfig = async () => {
if (cfg.images.use_img_proxy === undefined) {
cfg.images.use_img_proxy = true
}
cfg.app_version = defaultCfg.app_version
window.$GLS_Config = cfg
await initGolos()
}
Expand Down

0 comments on commit 4477196

Please sign in to comment.