Merge branch 'search-on-search-page' into dev
Build Docker Image / Docker-Build (push) Successful in 1m45s
Build Docker Image / Clean-Registry (push) Successful in 6s

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