Stringify supported nips
This commit is contained in:
@@ -105,4 +105,4 @@ routerContext.getPubkeyRelays = getPubkeyRelays
|
||||
routerContext.getRelayQuality = getRelayQuality
|
||||
routerContext.getDefaultRelays = _relayGetter()
|
||||
routerContext.getIndexerRelays = _relayGetter()
|
||||
routerContext.getSearchRelays = _relayGetter(r => r?.supported_nips?.includes?.(50))
|
||||
routerContext.getSearchRelays = _relayGetter(r => r?.supported_nips?.includes?.("50"))
|
||||
|
||||
@@ -39,6 +39,12 @@ export const fetchRelay = async (url: string): Promise<Maybe<RelayProfile>> => {
|
||||
if (json) {
|
||||
const info = {...json, url}
|
||||
|
||||
if (!Array.isArray(info.supported_nips)) {
|
||||
info.supported_nips = []
|
||||
}
|
||||
|
||||
info.supported_nips = info.supported_nips.map(String)
|
||||
|
||||
relaysByUrl.update($relaysByUrl => {
|
||||
$relaysByUrl.set(url, info)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ export const hasNegentropy = (url: string) => {
|
||||
const relay = getRelay(url)
|
||||
|
||||
if (relay?.negentropy) return true
|
||||
if (relay?.supported_nips?.includes?.(77)) return true
|
||||
if (relay?.supported_nips?.includes?.("77")) return true
|
||||
if (relay?.software?.includes?.("strfry") && !relay?.version?.match(/^0\./)) return true
|
||||
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user