Fix load bypassing freshness

This commit is contained in:
Jon Staab
2024-09-02 15:57:40 -07:00
parent 9a5a423b3e
commit b910569fc0
8 changed files with 80 additions and 61 deletions
+2 -10
View File
@@ -1,20 +1,12 @@
import {writable, derived} from 'svelte/store'
import {writable} from 'svelte/store'
import {withGetter} from '@welshman/store'
import type {Zapper} from '@welshman/util'
import {uniq, identity, bech32ToHex, indexBy, tryCatch, uniqBy, batcher, postJson} from '@welshman/lib'
import {uniq, identity, bech32ToHex, tryCatch, uniqBy, batcher, postJson} from '@welshman/lib'
import {env} from './core'
import {collection} from './collection'
import {profilesByPubkey} from './profiles'
export const zappers = withGetter(writable<Zapper[]>([]))
export const zappersByPubkey = derived([profilesByPubkey, zappers], ([$profilesByPubkey, $zappers]) =>
indexBy(
$zapper => $zapper.pubkey,
$zappers.filter($zapper => $zapper.pubkey && $profilesByPubkey.get($zapper.pubkey)?.lnurl === $zapper.lnurl),
),
)
export const fetchZappers = (lnurls: string[]) => {
const base = env.DUFFLEPUD_URL!