chore: simplify a function signature
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
WofWca 2023-03-03 16:35:41 +04:00 committed by kolaente
parent 2e0a0a3485
commit 0954984792
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 5 additions and 4 deletions

View File

@ -113,8 +113,8 @@ export const checkAndSetApiUrl = (url: string): Promise<string> => {
window.API_URL = oldUrl
throw e
})
.then(r => {
if (typeof r !== 'undefined') {
.then(success => {
if (success) {
localStorage.setItem('API_URL', window.API_URL)
return window.API_URL
}

View File

@ -79,11 +79,12 @@ export const useConfigStore = defineStore('config', () => {
function setConfig(config: ConfigState) {
Object.assign(state, config)
}
async function update() {
async function update(): Promise<boolean> {
const HTTP = HTTPFactory()
const {data: config} = await HTTP.get('info')
setConfig(objectToCamelCase(config))
return config
const success = !!config
return success
}
return {