mirror of
https://github.com/pheralb/svgl.git
synced 2024-11-13 08:46:56 +08:00
Merge pull request #429 from Jared-MB/main
⚙️ Listen to search params to clear results
This commit is contained in:
commit
1ae2e81836
@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { inputStyles } from '@/ui/styles';
|
||||
import { Command, SearchIcon } from 'lucide-svelte';
|
||||
export let searchTerm: string;
|
||||
@ -24,6 +25,17 @@
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let searchParams = {} as { [key: string]: string };
|
||||
|
||||
$: {
|
||||
if ($page) {
|
||||
searchParams = Object.fromEntries($page.url.searchParams);
|
||||
if (!searchParams?.search) {
|
||||
clearSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="sticky top-[63px] z-50">
|
||||
|
Loading…
Reference in New Issue
Block a user