fix(desktop): use stored URL instead of window.API_URL in template

window is not accessible as a global in Vue templates, causing
"Cannot read properties of undefined (reading 'API_URL')" when
clicking sign in on the desktop app.
This commit is contained in:
kolaente 2026-04-01 20:53:29 +02:00
parent eeb9caf87b
commit af7eaa9aea
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@
<XButton
:loading="waitingForAuth"
class="is-fullwidth"
@click="loginWithServer(window.API_URL)"
@click="loginWithServer(storedServerUrl!)"
>
{{ $t('user.auth.login') }}
</XButton>
@ -87,7 +87,8 @@ const {redirectIfSaved} = useRedirectToLastVisited()
const waitingForAuth = ref(false)
const errorMessage = ref('')
const hasStoredServer = localStorage.getItem('API_URL') !== null
const storedServerUrl = localStorage.getItem('API_URL')
const hasStoredServer = storedServerUrl !== null
const showCustomServerInput = ref(false)
listenForDesktopOAuthTokens(async (tokens) => {