From f375ebd5458c84d444953928a819b655021bfd83 Mon Sep 17 00:00:00 2001 From: 1aerostorm Date: Sat, 16 Nov 2024 07:38:18 +0300 Subject: [PATCH] Mobile app - Fix updates --- src/utils/app/UpdateUtils.js | 9 +++++++-- src/utils/initConfig.js | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/app/UpdateUtils.js b/src/utils/app/UpdateUtils.js index 2933db93d..f89da6693 100644 --- a/src/utils/app/UpdateUtils.js +++ b/src/utils/app/UpdateUtils.js @@ -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 }), @@ -84,6 +89,6 @@ export async function getChangelog(txtLink) { return res } catch (err) { console.error('getChangelog', err) - return '' + throw err } } diff --git a/src/utils/initConfig.js b/src/utils/initConfig.js index ab252c8dc..2dce1ebd2 100644 --- a/src/utils/initConfig.js +++ b/src/utils/initConfig.js @@ -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() }