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
@@ -1,8 +1,7 @@
import {writable, derived} from 'svelte/store'
import {withGetter} from '@welshman/store'
import {type SubscribeRequest} from "@welshman/net"
import {uniq, uniqBy, batcher, postJson, last} from '@welshman/lib'
import {AppContext} from './core'
import {ctx, uniq, uniqBy, batcher, postJson, last} from '@welshman/lib'
import {collection} from './collection'
import {deriveProfile} from './profiles'
@@ -16,10 +15,10 @@ export type Handle = {
export const handles = withGetter(writable<Handle[]>([]))
export const fetchHandles = (handles: string[]) => {
const base = AppContext.dufflepudUrl!
const base = ctx.app.dufflepudUrl!
if (!base) {
throw new Error("AppContext.dufflepudUrl is required to fetch nip05 info")
throw new Error("ctx.app.dufflepudUrl is required to fetch nip05 info")
}
const res: any = postJson(`${base}/handle/info`, {handles})