Make display profile stuff take undefined
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import {derived} from 'svelte/store'
|
import {derived, readable} from 'svelte/store'
|
||||||
import {readProfile, displayProfile, displayPubkey, PROFILE} from '@welshman/util'
|
import {readProfile, displayProfile, displayPubkey, PROFILE} from '@welshman/util'
|
||||||
import {type SubscribeRequest} from "@welshman/net"
|
import {type SubscribeRequest} from "@welshman/net"
|
||||||
import {type PublishedProfile} from "@welshman/util"
|
import {type PublishedProfile} from "@welshman/util"
|
||||||
@@ -36,8 +36,12 @@ export const profileSearch = derived(profiles, $profiles =>
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
export const displayProfileByPubkey = (pubkey = "") =>
|
export const displayProfileByPubkey = (pubkey: string | undefined) =>
|
||||||
displayProfile(profilesByPubkey.get().get(pubkey), displayPubkey(pubkey))
|
pubkey
|
||||||
|
? displayProfile(profilesByPubkey.get().get(pubkey), displayPubkey(pubkey))
|
||||||
|
: ""
|
||||||
|
|
||||||
export const deriveProfileDisplay = (pubkey = "") =>
|
export const deriveProfileDisplay = (pubkey: string | undefined) =>
|
||||||
derived(deriveProfile(pubkey), $profile => displayProfile($profile, displayPubkey(pubkey)))
|
pubkey
|
||||||
|
? derived(deriveProfile(pubkey), $profile => displayProfile($profile, displayPubkey(pubkey)))
|
||||||
|
: readable("")
|
||||||
|
|||||||
Reference in New Issue
Block a user