fix: don't try to set config from non-json responses

This commit is contained in:
kolaente 2023-07-05 17:37:07 +02:00
parent ae2b0f97c4
commit 7c1934aad0
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 0 deletions

View File

@ -82,6 +82,9 @@ export const useConfigStore = defineStore('config', () => {
async function update(): Promise<boolean> {
const HTTP = HTTPFactory()
const {data: config} = await HTTP.get('info')
if (typeof config.version === 'undefined') {
return false
}
setConfig(objectToCamelCase(config))
const success = !!config
return success