1
0
Fork 0

Fix inital page load search

This commit is contained in:
Leon Grünewald 2024-03-29 13:32:31 +01:00
parent 42a300de0a
commit e844b67e45

View file

@ -15,7 +15,7 @@
import PostList from '$lib/PostList';
const drawerStore = getDrawerStore();
const toastStore = getToastStore();
let initalSearch = true;
function onSearch() {
$loading = true;
@ -25,11 +25,14 @@
});
}
if ($postSearchResults === null) {
onSearch();
}
lastSearch.subscribe(() => {
if (initalSearch) {
initalSearch = false;
if ($postSearchResults === null) onSearch();
return
}
onSearch();
})
</script>