diff --git a/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue b/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue index 8620ad318..2934afedb 100644 --- a/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue +++ b/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue @@ -33,8 +33,10 @@ import UserLocationMap from '@/components/UserSettings/UserLocationMap' import { BButton, BModal } from 'bootstrap-vue-next' import { userLocationQuery } from '@/graphql/queries' import CONFIG from '@/config' +import { useStore } from 'vuex' const { t } = useI18n() +const store = useStore() const { mutate: updateUserInfo } = useMutation(updateUserInfos) const { onResult, onError } = useQuery(userLocationQuery, {}, { fetchPolicy: 'network-only' }) const { toastSuccess, toastError } = useAppToast() @@ -73,14 +75,11 @@ const saveUserLocation = async () => { try { const loc = { longitude: capturedLocation.value.lng, latitude: capturedLocation.value.lat } - await updateUserInfo({ - gmsLocation: { - longitude: capturedLocation.value.lng, - latitude: capturedLocation.value.lat, - }, - }) + await updateUserInfo({ gmsLocation: loc }) toastSuccess(t('settings.GMS.location.updateSuccess')) userLocation.value = capturedLocation.value + // update in local storage to update button on overview + store.commit('userLocation', loc) isModalOpen.value = false } catch (error) { toastError(error.message)