remove unneccessary code, make gms request working on mount

This commit is contained in:
einhornimmond 2025-03-29 08:20:02 +01:00
parent b49f18c9a7
commit eab0817eb9
2 changed files with 6 additions and 17 deletions

View File

@ -1,5 +1,5 @@
<template>
<div v-if="humhubAllowed" class="mb-3 p-3 card-circles">
<div class="mb-3 p-3 card-circles">
<BContainer class="bg-white app-box-shadow gradido-border-radius p-4 mt--3">
<div class="h3">{{ $t('card-circles.headline') }}</div>
<div v-if="humhubAllowed" class="my-3 text-small">
@ -56,11 +56,7 @@ const humhubUri = ref('')
const humhubAllowed = computed(() => store.state.humhubAllowed)
const {
refetch: refetchAuthenticateHumhub,
onResult,
onError,
} = useQuery(authenticateHumhubAutoLogin, null, {
const { onResult, onError } = useQuery(authenticateHumhubAutoLogin, null, {
fetchPolicy: 'network-only',
enabled: true,
})
@ -77,16 +73,6 @@ onError(() => {
humhubUri.value = ''
store.commit('humhubAllowed', false)
})
const handleAuthenticateHumhubAutoLogin = async () => {
enableButton.value = false
humhubUri.value = null
await refetchAuthenticateHumhub()
}
onMounted(() => {
handleAuthenticateHumhubAutoLogin()
})
</script>
<style scoped>
.card {

View File

@ -75,7 +75,10 @@ const gmsUserLocationExists = store.state.userLocation !== null
// console.log('gmsUserLocationExists=', gmsUserLocationExists)
const isUserSearchDisabled = computed(() => gmsUri.value !== null)
const { onResult, result, loading, onError } = useQuery(authenticateGmsUserSearch)
const { onResult, result, loading, onError } = useQuery(authenticateGmsUserSearch, null, {
fetchPolicy: 'network-only',
enabled: true,
})
onResult(({ data }) => {
if (gmsAllowed && gmsUserLocationExists && data !== undefined) {