diff --git a/src/app/shared/PersonSearch.svelte b/src/app/shared/PersonSearch.svelte
index 264f12a8..27158596 100644
--- a/src/app/shared/PersonSearch.svelte
+++ b/src/app/shared/PersonSearch.svelte
@@ -1,5 +1,6 @@
diff --git a/src/app/views/Search.svelte b/src/app/views/Search.svelte
index 1ecda4c9..ffb9f8ba 100644
--- a/src/app/views/Search.svelte
+++ b/src/app/views/Search.svelte
@@ -15,7 +15,21 @@
let q
- $: searchPeople(q)
+ const openTopic = topic => {
+ modal.push({type: "topic/feed", topic})
+ }
+
+ const loadPeople = debounce(500, search => {
+ if (q.length > 2) {
+ network.load({
+ relays: getUserReadRelays(),
+ filter: [{kinds: [0], search, limit: 10}],
+ })
+ }
+ })
+
+ $: loadPeople(q)
+
$: search = watch(["people", "topics"], (p, t) => {
const topics = t
.all()
@@ -33,19 +47,6 @@
return fuzzy(sortBy(prop("id"), topics.concat(people)), {keys: ["text"]})
})
- const openTopic = topic => {
- modal.push({type: "topic/feed", topic})
- }
-
- const searchPeople = debounce(500, search => {
- if (q.length > 2) {
- network.load({
- relays: getUserReadRelays(),
- filter: [{kinds: [0], search, limit: 10}],
- })
- }
- })
-
document.title = "Search"