mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-29 00:10:52 +00:00
Load pubkeys when searching, bump net
This commit is contained in:
parent
3f49f441a8
commit
53c44d4f0d
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -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",
|
||||
|
@ -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}
|
||||
|
@ -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"}
|
||||
|
Loading…
Reference in New Issue
Block a user