update space screen
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user