add PIN kind utilities

This commit is contained in:
Ticruz
2025-01-16 17:47:28 +01:00
parent 3c100a8ce6
commit b334da9389
4 changed files with 53 additions and 2 deletions
+8
View File
@@ -2,6 +2,7 @@ import {derived} from "svelte/store"
import {pubkey} from "./session.js"
import {profilesByPubkey, loadProfile} from "./profiles.js"
import {followsByPubkey, loadFollows} from "./follows.js"
import {loadPins, pinsByPubkey} from "./pins.js"
import {mutesByPubkey, loadMutes} from "./mutes.js"
import {
relaySelectionsByPubkey,
@@ -35,6 +36,13 @@ export const userMutes = derived([mutesByPubkey, pubkey], ([$mutesByPubkey, $pub
return $mutesByPubkey.get($pubkey)
})
export const userPins = derived([pinsByPubkey, pubkey], ([$pinsByPubkey, $pubkey]) => {
if (!$pubkey) return undefined
loadPins($pubkey)
return $pinsByPubkey.get($pubkey)
})
export const userRelaySelections = derived(
[relaySelectionsByPubkey, pubkey],
([$relaySelectionsByPubkey, $pubkey]) => {