From 8552649c94a2de6c5cc80d6e2cd3f467fc12f06a Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 2 Apr 2025 15:20:42 +0200 Subject: [PATCH] use computed for react on changing state --- frontend/src/components/Overview/CardUserSearch.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Overview/CardUserSearch.vue b/frontend/src/components/Overview/CardUserSearch.vue index ab0d71c2d..ec7de2da8 100644 --- a/frontend/src/components/Overview/CardUserSearch.vue +++ b/frontend/src/components/Overview/CardUserSearch.vue @@ -69,9 +69,10 @@ console.log( store.state.userLocation, ) */ -const gmsAllowed = store.state.gmsAllowed +// use computed to react on state change, when user goes to settings and change something an get back here +const gmsAllowed = computed(() => store.state.gmsAllowed) // console.log('gmsAllowed=', gmsAllowed) -const gmsUserLocationExists = store.state.userLocation !== null +const gmsUserLocationExists = computed(() => store.state.userLocation !== null) // console.log('gmsUserLocationExists=', gmsUserLocationExists) const isUserSearchDisabled = computed(() => gmsUri.value === null)