fix: api config domain name contains the current domain instead of the provided one (#1581)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1581 Reviewed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
f9309c30b0
commit
bdb53ec8ee
1 changed files with 6 additions and 4 deletions
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, computed, watch} from 'vue'
|
import {ref, computed, watch} from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {parseURL} from 'ufo'
|
import {parseURL} from 'ufo'
|
||||||
|
|
||||||
import {checkAndSetApiUrl} from '@/helpers/checkAndSetApiUrl'
|
import {checkAndSetApiUrl} from '@/helpers/checkAndSetApiUrl'
|
||||||
|
@ -61,18 +61,20 @@ const emit = defineEmits(['foundApi'])
|
||||||
const apiUrl = ref(window.API_URL)
|
const apiUrl = ref(window.API_URL)
|
||||||
const configureApi = ref(apiUrl.value === '')
|
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) => {
|
watch(() => props.configureOpen, (value) => {
|
||||||
configureApi.value = value
|
configureApi.value = value
|
||||||
}, { immediate: true })
|
}, {immediate: true})
|
||||||
|
|
||||||
|
|
||||||
const {t} = useI18n()
|
const {t} = useI18n()
|
||||||
|
|
||||||
const errorMsg = ref('')
|
const errorMsg = ref('')
|
||||||
const successMsg = ref('')
|
const successMsg = ref('')
|
||||||
|
|
||||||
async function setApiUrl() {
|
async function setApiUrl() {
|
||||||
if (apiUrl.value === '') {
|
if (apiUrl.value === '') {
|
||||||
// Don't try to check and set an empty url
|
// Don't try to check and set an empty url
|
||||||
|
|
Loading…
Reference in a new issue