Load pubkeys when searching, bump net

This commit is contained in:
Jon Staab 2024-05-24 14:39:38 -07:00
parent 3f49f441a8
commit 53c44d4f0d
4 changed files with 23 additions and 11 deletions

BIN
package-lock.json generated

Binary file not shown.

View File

@ -57,7 +57,7 @@
"@scure/base": "^1.1.6",
"@welshman/feeds": "^0.0.9",
"@welshman/lib": "^0.0.8",
"@welshman/net": "^0.0.10",
"@welshman/net": "^0.0.11",
"@welshman/util": "^0.0.11",
"classnames": "^2.5.1",
"compressorjs": "^1.2.1",

View File

@ -37,12 +37,11 @@
<div class="flex justify-between">
<span class="flex items-start gap-3">
<div>
<span
class="staatliches text-xl"
class:text-neutral-400={!feed.title}
class:line-through={deleted}>
{displayFeed(feed)}
</span>
<Anchor on:click={loadFeed} class="staatliches text-xl">
<span class:text-neutral-400={!feed.title} class:line-through={deleted}>
{displayFeed(feed)}
</span>
</Anchor>
{#if deleted}
<Chip danger small>Deleted</Chip>
{/if}

View File

@ -5,7 +5,7 @@
import SearchSelect from "src/partials/SearchSelect.svelte"
import PersonBadge from "src/app/shared/PersonBadge.svelte"
import {router} from "src/app/util/router"
import {searchPubkeys, displayPubkey} from "src/engine"
import {searchPubkeys, createPeopleLoader, displayPubkey} from "src/engine"
export let value
export let multiple = false
@ -14,14 +14,20 @@
let input
const {loading, load} = createPeopleLoader()
const search = term => {
if (term.length > 2) {
load(term)
}
parseAnything(term).then(result => {
if (result?.type === 'npub') {
if (result?.type === "npub") {
value = uniq(value.concat(result.data))
input.clearTerm()
}
if (result?.type === 'nprofile') {
if (result?.type === "nprofile") {
value = uniq(value.concat(result.data.pubkey))
input.clearTerm()
}
@ -31,7 +37,14 @@
}
</script>
<SearchSelect {multiple} {autofocus} bind:this={input} bind:value {search} {onChange}>
<SearchSelect
{search}
{onChange}
{multiple}
{autofocus}
bind:value
bind:this={input}
loading={$loading}>
<div slot="item" let:item let:context>
<div class="-my-1">
{#if context === "value"}