Fix address selector

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-10-05 17:42:12 +02:00
parent 1a9aef00e5
commit fee4f9add8
19 changed files with 890 additions and 736 deletions

View File

@@ -131,7 +131,11 @@
</span>
</section>
<!-- Recent events -->
<CloseEvents @doGeoLoc="performGeoLocation()" :userLocation="userLocation" />
<CloseEvents
@doGeoLoc="performGeoLocation()"
:userLocation="userLocation"
:doingGeoloc="doingGeoloc"
/>
<CloseGroups :userLocation="userLocation" @doGeoLoc="performGeoLocation()" />
<OnlineEvents />
<LastEvents v-if="instanceName" :instanceName="instanceName" />
@@ -224,7 +228,9 @@ const { result: aboutConfigResult } = useQuery<{
IConfig,
"name" | "description" | "slogan" | "registrationsOpen"
>;
}>(ABOUT);
}>(ABOUT, undefined, {
fetchPolicy: "cache-only",
});
const config = computed(() => aboutConfigResult.value?.config);
@@ -507,10 +513,19 @@ GeolocationPosition) => {
reverseGeoCodeInformation.latitude = latitude;
reverseGeoCodeInformation.longitude = longitude;
reverseGeoCodeInformation.accuracy = accuracy;
doingGeoloc.value = false;
};
const doingGeoloc = ref(false);
const performGeoLocation = () => {
navigator.geolocation.getCurrentPosition(fetchAndSaveCurrentLocationName);
doingGeoloc.value = true;
navigator.geolocation.getCurrentPosition(
fetchAndSaveCurrentLocationName,
() => {
doingGeoloc.value = false;
}
);
};
/**