Bump versions, move getAdapter to context
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@welshman/app",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
"description": "A collection of svelte stores for use in building nostr client applications.",
|
||||
@@ -27,14 +27,14 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/throttle-debounce": "^5.0.2",
|
||||
"@welshman/dvm": "^0.0.15",
|
||||
"@welshman/feeds": "^0.1.0",
|
||||
"@welshman/lib": "^0.1.0",
|
||||
"@welshman/relay": "^0.1.0",
|
||||
"@welshman/net": "^0.0.49",
|
||||
"@welshman/signer": "^0.1.1",
|
||||
"@welshman/store": "^0.1.0",
|
||||
"@welshman/util": "^0.1.0",
|
||||
"@welshman/dvm": "^0.1.1",
|
||||
"@welshman/feeds": "^0.1.1",
|
||||
"@welshman/lib": "^0.1.1",
|
||||
"@welshman/relay": "^0.1.1",
|
||||
"@welshman/net": "^0.1.1",
|
||||
"@welshman/signer": "^0.1.3",
|
||||
"@welshman/store": "^0.1.2",
|
||||
"@welshman/util": "^0.1.2",
|
||||
"fuse.js": "^7.0.0",
|
||||
"idb": "^8.0.0",
|
||||
"svelte": "^4.2.18",
|
||||
|
||||
@@ -175,7 +175,7 @@ export const getPubkeyRelays = (pubkey: string, mode?: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const globalRouterOptions: RouterOptions = {
|
||||
export const routerContext: RouterOptions = {
|
||||
getRelayQuality,
|
||||
getPubkeyRelays,
|
||||
getFallbackRelays: () => ["wss://relay.damus.io/", "wss://nos.lol/"],
|
||||
@@ -191,15 +191,15 @@ export class Router {
|
||||
readonly options: RouterOptions
|
||||
|
||||
static configure(options: RouterOptions) {
|
||||
Object.assign(globalRouterOptions, options)
|
||||
Object.assign(routerContext, options)
|
||||
}
|
||||
|
||||
static get() {
|
||||
return new Router(globalRouterOptions)
|
||||
return new Router(routerContext)
|
||||
}
|
||||
|
||||
constructor(options: RouterOptions) {
|
||||
this.options = mergeLeft(options, globalRouterOptions)
|
||||
this.options = mergeLeft(options, routerContext)
|
||||
}
|
||||
|
||||
// Utilities derived from options
|
||||
@@ -420,7 +420,7 @@ type FilterSelectionRule = (filter: Filter) => FilterScenario[]
|
||||
export const getFilterSelectionsForSearch = (filter: Filter) => {
|
||||
if (!filter.search) return []
|
||||
|
||||
const relays = globalRouterOptions.getSearchRelays?.() || []
|
||||
const relays = routerContext.getSearchRelays?.() || []
|
||||
|
||||
return [{filter, scenario: Router.get().FromRelays(relays).weight(10)}]
|
||||
}
|
||||
@@ -441,7 +441,7 @@ export const getFilterSelectionsForIndexedKinds = (filter: Filter) => {
|
||||
|
||||
if (kinds.length === 0) return []
|
||||
|
||||
const relays = globalRouterOptions.getIndexerRelays?.() || []
|
||||
const relays = routerContext.getIndexerRelays?.() || []
|
||||
|
||||
return [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user