1
0

fix: computed in api-config (#777)

Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/777
Co-authored-by: dpschen <dpschen@noreply.kolaente.de>
Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
dpschen
2021-09-23 05:09:47 +00:00
committed by konrad
parent 649bbd8c9b
commit 3245752a80
3 changed files with 9 additions and 7 deletions

View File

@ -46,6 +46,8 @@
</template>
<script>
import { parseURL } from 'ufo'
const API_DEFAULT_PORT = 3456
export default {
@ -65,13 +67,7 @@ export default {
},
computed: {
apiDomain() {
if (window.API_URL.startsWith('/api/v1')) {
return window.location.host
}
const urlParts = window.API_URL.replace('http://', '')
.replace('https://', '')
.split(/[/?#]/)
return urlParts[0]
return parseURL(this.apiUrl).host
},
},
methods: {