diff --git a/.gitignore b/.gitignore index 78740c3ba..edd5635b0 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,5 @@ dist # React build output build/ -cordova/ \ No newline at end of file +cordova/ +src/app/default_cfg.js diff --git a/src/app/default_cfg.js b/src/app/default_cfg.js deleted file mode 100644 index 09a45400d..000000000 --- a/src/app/default_cfg.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - "app_version": "1.0.0", - "nodes": [ - { - "address": "wss://apibeta.golos.today/ws" - } - ], - "images": { - "img_proxy_prefix": "https://devimages.golos.today", - "img_proxy_backup_prefix": "https://steemitimages.com", - "upload_image": "https://api.imgur.com/3/image", - "client_id": "6c09ebf8c548126" - }, - "auth_service": { - "host": "https://dev.golos.app", - "custom_client": "blogs" - }, - "notify_service": { - "host": "https://devnotify.golos.app" - }, - "blogs_service": { - "host": "https://beta.golos.today" - }, - "app_updater": { - "host": "https://files.golos.app" - } -} \ No newline at end of file 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() }