repaired search input in menu on search page
Build Docker Image / Docker-Build (push) Successful in 1m30s
Build Docker Image / Clean-Registry (push) Successful in 6s

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2026-09-16 08:46:19 +02:00
parent 3b509b40e0
commit 0bb4dc2db7
+9 -12
View File
@@ -14,8 +14,7 @@
let companies = $state(null);
let documents = $state(null);
let fulltext = false;
let key = $state(router.getQueryParam('key'));
let input = $state(router.getQueryParam('key'));
let input = $state(null);
let notes = $state(null);
let pages = $state(null);
let projects = $state(null);
@@ -25,16 +24,10 @@
async function setKey(ev){
if (ev) ev.preventDefault();
key = input;
doSearch(null);
doSearch(input);
}
onMount(() => {
let params = new URLSearchParams(location.search);
key = params.get('key');
});
function doSearch(ignored){
function doSearch(key){
warn(t('searching…'));
let url = window.location.origin + window.location.pathname;
if (key) url += '?key=' + encodeURI(key);
@@ -182,11 +175,15 @@
} else yikes();
}
$effect(() => doSearch(key))
$effect(() => {
input = router.getQueryParam('key');
doSearch(input);
}
);
</script>
<svelte:head>
<title>Umbrella {t('search')}: {key}</title>
<title>Umbrella {t('search')}{input?': '+input:''}</title>
</svelte:head>