update space screen

This commit is contained in:
Ren Amamiya
2023-08-22 09:10:04 +07:00
parent 917e49b25d
commit 4830f0b236
33 changed files with 766 additions and 255 deletions

View File

@@ -30,12 +30,17 @@ export function useEvent(id: string, embed?: string) {
} else {
// get event from relay if event in db not present
const event = await ndk.fetchEvent(id);
if (event.kind === 1) richContent = parser(event);
if (!event) throw new Error(`Event not found: ${id}`);
if (event.kind === 1) {
richContent = parser(event);
}
return { event: event, richContent: richContent };
}
},
{
enabled: !!ndk,
staleTime: Infinity,
refetchOnMount: false,
refetchOnWindowFocus: false,

View File

@@ -109,7 +109,7 @@ export function useNostr() {
const events = fetcher.allEventsIterator(
relayUrls,
{
kinds: [1, 6],
kinds: [NDKKind.Text, NDKKind.Repost, 1063, NDKKind.Article],
authors: db.account.network,
},
{ since: since }

View File

@@ -20,7 +20,7 @@ export function useProfile(pubkey: string, embed?: string) {
user.profile.display_name = user.profile.displayName;
return user.profile;
} else {
throw new Error('User not found');
throw new Error(`User not found: ${pubkey}`);
}
} else {
const profile: NDKUserProfile = JSON.parse(embed);