fix: api config domain name contains the current domain instead of the provided one
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
kolaente 2022-02-20 22:38:10 +01:00 committed by Gitea
parent f9309c30b0
commit 661cc45235
1 changed files with 6 additions and 4 deletions

View File

@ -61,8 +61,9 @@ const emit = defineEmits(['foundApi'])
const apiUrl = ref(window.API_URL)
const configureApi = ref(apiUrl.value === '')
const apiDomain = computed(() => parseURL(apiUrl.value).host || parseURL(window.location.href).host)
// Because we're only using this to parse the hostname, it should be fine to just prefix with http://
// regardless of whether the url is actually reachable under http.
const apiDomain = computed(() => parseURL(apiUrl.value, 'http://').host || parseURL(window.location.href).host)
watch(() => props.configureOpen, (value) => {
configureApi.value = value
@ -73,6 +74,7 @@ const {t} = useI18n()
const errorMsg = ref('')
const successMsg = ref('')
async function setApiUrl() {
if (apiUrl.value === '') {
// Don't try to check and set an empty url