fix: api not found by default

This commit is contained in:
kolaente 2021-11-16 22:34:08 +01:00
parent ae0ecb9f23
commit 26213d5e8c
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -7,6 +7,10 @@ export const ERROR_NO_API_URL = 'noApiUrlProvided'
const updateConfig = () => store.dispatch('config/update') const updateConfig = () => store.dispatch('config/update')
export const checkAndSetApiUrl = (url: string): Promise<string> => { export const checkAndSetApiUrl = (url: string): Promise<string> => {
if(url.startsWith('/')) {
url = window.location.host + url
}
// Check if the url has an http prefix // Check if the url has an http prefix
if ( if (
!url.startsWith('http://') && !url.startsWith('http://') &&