fixes lists back button
This commit is contained in:
@@ -117,10 +117,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function back() {
|
async function back() {
|
||||||
if (loadAllListsOnNextBack) {
|
|
||||||
await updateFilter();
|
|
||||||
loadAllListsOnNextBack = false;
|
|
||||||
}
|
|
||||||
if (selectedTrail) {
|
if (selectedTrail) {
|
||||||
selectedTrail = null;
|
selectedTrail = null;
|
||||||
} else if (selectedList) {
|
} else if (selectedList) {
|
||||||
@@ -131,6 +127,10 @@
|
|||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (loadAllListsOnNextBack) {
|
||||||
|
await updateFilter(false);
|
||||||
|
loadAllListsOnNextBack = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function selectTrail(trail: Trail) {
|
async function selectTrail(trail: Trail) {
|
||||||
@@ -178,10 +178,10 @@
|
|||||||
pagination.totalPages = response.totalPages;
|
pagination.totalPages = response.totalPages;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateFilter() {
|
async function updateFilter(resetMap: boolean = true) {
|
||||||
loading = true;
|
loading = true;
|
||||||
|
|
||||||
if (selectedList || selectedTrail) {
|
if ((selectedList || selectedTrail) && resetMap) {
|
||||||
selectedList = null;
|
selectedList = null;
|
||||||
selectedTrail = null;
|
selectedTrail = null;
|
||||||
map?.flyTo({
|
map?.flyTo({
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
disabled={!selectedList}
|
disabled={!selectedList}
|
||||||
onclick={back}><i class="fa fa-arrow-left"></i></button
|
onclick={back}><i class="fa fa-arrow-left"></i></button
|
||||||
>
|
>
|
||||||
<Search bind:value={filter.q} onupdate={updateFilter}></Search>
|
<Search bind:value={filter.q} onupdate={() => updateFilter()}></Search>
|
||||||
<button
|
<button
|
||||||
aria-label="Toggle filter"
|
aria-label="Toggle filter"
|
||||||
class="btn-icon"
|
class="btn-icon"
|
||||||
|
|||||||
Reference in New Issue
Block a user