fix: 🐛

This commit is contained in:
codytseng
2025-01-26 20:19:18 +08:00
parent 2873b9bdd8
commit 8ef1afc4b9
5 changed files with 37 additions and 15 deletions

View File

@@ -2,11 +2,12 @@ import client from '@/services/client.service'
import { TRelayInfo } from '@/types'
import { useEffect, useState } from 'react'
export function useFetchRelayInfo(url: string) {
export function useFetchRelayInfo(url?: string) {
const [isFetching, setIsFetching] = useState(true)
const [relayInfo, setRelayInfo] = useState<TRelayInfo | undefined>(undefined)
useEffect(() => {
if (!url) return
const fetchRelayInfos = async () => {
setIsFetching(true)
const timer = setTimeout(() => {