render reply and sub reply accordingly
This commit is contained in:
@@ -16,6 +16,7 @@ export function useProfile(pubkey: string, fallback?: string) {
|
||||
const current = Math.floor(Date.now() / 1000);
|
||||
const cache = await getUserMetadata(pubkey);
|
||||
if (cache && parseInt(cache.created_at) + 86400 >= current) {
|
||||
console.log('cache hit - ', cache);
|
||||
return cache;
|
||||
} else {
|
||||
const filter: NDKFilter = { kinds: [0], authors: [pubkey] };
|
||||
@@ -24,6 +25,8 @@ export function useProfile(pubkey: string, fallback?: string) {
|
||||
if (latest) {
|
||||
await createMetadata(pubkey, pubkey, latest.content);
|
||||
return JSON.parse(latest.content);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user