fix: 🐛

This commit is contained in:
codytseng 2025-11-11 21:53:57 +08:00
parent 485ca82e30
commit 8ed28a79b1
4 changed files with 12 additions and 12 deletions

View file

@ -52,23 +52,20 @@ export function FeedProvider({ children }: { children: React.ReactNode }) {
}
}
if (!feedInfo) {
setIsReady(true)
return
}
if (feedInfo.feedType === 'relays') {
if (feedInfo?.feedType === 'relays') {
return await switchFeed('relays', { activeRelaySetId: feedInfo.id })
}
if (feedInfo.feedType === 'relay') {
if (feedInfo?.feedType === 'relay') {
return await switchFeed('relay', { relay: feedInfo.id })
}
// update following feed if pubkey changes
if (feedInfo.feedType === 'following' && pubkey) {
if (feedInfo?.feedType === 'following' && pubkey) {
return await switchFeed('following', { pubkey })
}
setIsReady(true)
}
init()

View file

@ -704,7 +704,7 @@ export function NostrProvider({ children }: { children: React.ReactNode }) {
}
const updateRelayListEvent = async (relayListEvent: Event) => {
const newRelayList = await indexedDb.putReplaceableEvent(relayListEvent)
const newRelayList = await client.updateRelayListCache(relayListEvent)
setRelayList(getRelayListFromEvent(newRelayList))
}