rework context

This commit is contained in:
Jon Staab
2024-09-05 13:38:48 -07:00
parent 233a4e3576
commit 44f29c9da4
19 changed files with 157 additions and 138 deletions
+3 -4
View File
@@ -2,18 +2,17 @@ import {writable, derived} from 'svelte/store'
import {withGetter} from '@welshman/store'
import {type Zapper} from '@welshman/util'
import {type SubscribeRequest} from "@welshman/net"
import {uniq, identity, bech32ToHex, tryCatch, uniqBy, batcher, postJson} from '@welshman/lib'
import {AppContext} from './core'
import {ctx, uniq, identity, bech32ToHex, tryCatch, uniqBy, batcher, postJson} from '@welshman/lib'
import {collection} from './collection'
import {deriveProfile} from './profiles'
export const zappers = withGetter(writable<Zapper[]>([]))
export const fetchZappers = (lnurls: string[]) => {
const base = AppContext.dufflepudUrl!
const base = ctx.app.dufflepudUrl!
if (!base) {
throw new Error("AppContext.dufflepudUrl is required to fetch zapper info")
throw new Error("ctx.app.dufflepudUrl is required to fetch zapper info")
}
const zappersByLnurl = new Map<string, Zapper>()