fix errors

This commit is contained in:
Ren Amamiya
2023-07-20 17:14:32 +07:00
parent bbfdb139c6
commit 8f4cf7e948
10 changed files with 214 additions and 223 deletions

View File

@@ -47,7 +47,7 @@ export function useEvent(id: string, fallback?: string) {
}
return event;
} else {
return null;
throw new Error('Event not found');
}
}
}

View File

@@ -1,20 +1,18 @@
import { NDKEvent, NDKFilter } from '@nostr-dev-kit/ndk';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { useNDK } from '@libs/ndk/provider';
import { createNote } from '@libs/storage';
import { dateToUnix, getHourAgo, nHoursAgo } from '@utils/date';
import { nHoursAgo } from '@utils/date';
import { useAccount } from '@utils/hooks/useAccount';
import { usePublish } from '@utils/hooks/usePublish';
import { nip02ToArray } from '@utils/transform';
import { LumeEvent } from '@utils/types';
export function useSocial() {
const queryClient = useQueryClient();
const publish = usePublish();
const { ndk, fetcher, relayUrls } = useNDK();
const { fetcher, relayUrls } = useNDK();
const { account } = useAccount();
const { status, data: userFollows } = useQuery(
['userFollows', account.pubkey],