feat: explore (#85)

This commit is contained in:
Cody Tseng 2025-02-11 16:33:31 +08:00 committed by GitHub
parent 80893ec033
commit b91f46723e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 811 additions and 179 deletions

View file

@ -1,5 +1,5 @@
import { checkAlgoRelay } from '@/lib/relay'
import client from '@/services/client.service'
import relayInfoService from '@/services/relay-info.service'
import { TRelayInfo } from '@/types'
import { useEffect, useState } from 'react'
@ -20,7 +20,7 @@ export function useFetchRelayInfos(urls: string[]) {
setIsFetching(false)
}, 5000)
try {
const relayInfos = await client.fetchRelayInfos(urls)
const relayInfos = await relayInfoService.getRelayInfos(urls)
setRelayInfos(relayInfos)
setAreAlgoRelays(relayInfos.every((relayInfo) => checkAlgoRelay(relayInfo)))
setSearchableRelayUrls(