feat: bypass IndexedDB cache when viewing user profile

This commit is contained in:
codytseng
2025-05-20 23:16:49 +08:00
parent e3c8dc838d
commit 5c39413420
3 changed files with 4 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import client from '@/services/client.service'
import { TProfile } from '@/types'
import { useEffect, useState } from 'react'
export function useFetchProfile(id?: string) {
export function useFetchProfile(id?: string, skipCache = false) {
const { profile: currentAccountProfile } = useNostr()
const [isFetching, setIsFetching] = useState(true)
const [error, setError] = useState<Error | null>(null)
@@ -25,7 +25,7 @@ export function useFetchProfile(id?: string) {
const pubkey = userIdToPubkey(id)
setPubkey(pubkey)
const profile = await client.fetchProfile(id)
const profile = await client.fetchProfile(id, skipCache)
if (profile) {
setProfile(profile)
}