merge-upstream-5.0.1 #66

Merged
778a69cd merged 80 commits from merge-upstream-5.0.1 into main 2024-12-26 12:55:41 +01:00
3 changed files with 20 additions and 2 deletions
Showing only changes of commit 9403a9d60a - Show all commits

View file

@ -374,7 +374,7 @@ const asyncData = async (query: string): Promise<void> => {
};
const selectedAddressText = computed(() => {
if (!selected) return undefined;
if (!selected || !selected.id) return undefined;
return addressFullName(selected);
});

View file

@ -27,6 +27,7 @@
:default-text="locationDefaultText"
labelClass="sr-only"
:placeholder="t('e.g. Nantes, Berlin, Cork, …')"
v-on:update:modelValue="modelValueUpdate"
/>
<o-button native-type="submit" icon-left="magnify">
<template v-if="search">{{ t("Go!") }}</template>
@ -95,6 +96,10 @@ const search = computed({
},
});
const modelValueUpdate = (newlocation: IAddress | null) => {
emit("update:location", newlocation);
};
const submit = () => {
emit("submit");
const { lat, lon } = addressToLocation(location.value);

View file

@ -29,7 +29,8 @@
<search-fields
v-model:search="search"
v-model:location="location"
:locationDefaultText="location?.description"
:locationDefaultText="location?.description ?? userLocation?.name"
v-on:update:location="updateLocation"
:fromLocalStorage="true"
/>
<!-- Categories preview -->
@ -237,6 +238,7 @@ const currentUserParticipations = computed(
const location = ref(null);
const search = ref("");
const noLocation = ref(false);
watch(location, (newLoc, oldLoc) =>
console.debug("LOCATION UPDATED from", { ...oldLoc }, " to ", { ...newLoc })
@ -428,6 +430,13 @@ const currentUserLocation = computed(() => {
const userLocation = computed(() => {
console.debug("new userLocation");
if (noLocation.value) {
return {
lon: null,
lat: null,
name: null,
};
}
if (location.value) {
console.debug("userLocation is typed location");
return addressToLocation(location.value);
@ -502,6 +511,10 @@ const performGeoLocation = () => {
);
};
const updateLocation = (newlocation: IAddress | null) => {
noLocation.value = newlocation == null;
};
/**
* View Head
*/