mirror of
https://github.com/hoornet/vega.git
synced 2026-05-01 18:19:58 -07:00
Fix profile cache invalidation after editing
Invalidate the in-memory profile cache for the user's pubkey after publishing a new kind 0 event, so the updated profile reflects immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,11 @@ import { fetchProfile } from "../lib/nostr";
|
||||
const profileCache = new Map<string, any>();
|
||||
const pendingRequests = new Map<string, Promise<any>>();
|
||||
|
||||
export function invalidateProfileCache(pubkey: string) {
|
||||
profileCache.delete(pubkey);
|
||||
pendingRequests.delete(pubkey);
|
||||
}
|
||||
|
||||
export function useProfile(pubkey: string) {
|
||||
const [profile, setProfile] = useState<any>(profileCache.get(pubkey) ?? null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user