From 1c9420f370dd53041a7d9e2cdcf30e4089822c7c Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sun, 19 Mar 2023 17:32:00 +0700 Subject: [PATCH] minor fixes --- src/components/columns/account/active.tsx | 4 +--- src/components/columns/account/list.tsx | 4 ++-- src/components/note/content/metadata.tsx | 5 +---- src/pages/newsfeed/following.tsx | 6 +----- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/columns/account/active.tsx b/src/components/columns/account/active.tsx index 4f990c9b..24fcb139 100644 --- a/src/components/columns/account/active.tsx +++ b/src/components/columns/account/active.tsx @@ -53,9 +53,7 @@ export const ActiveAccount = memo(function ActiveAccount({ user }: { user: any } insertFollows(event.tags); }, undefined, - (events, relayURL) => { - console.log(events, relayURL); - }, + undefined, { unsubscribeOnEose: true, } diff --git a/src/components/columns/account/list.tsx b/src/components/columns/account/list.tsx index 062013f0..131edf0c 100644 --- a/src/components/columns/account/list.tsx +++ b/src/components/columns/account/list.tsx @@ -12,9 +12,9 @@ export default function AccountList() { const renderAccount = useCallback( (user: { id: string }) => { if (user.id === currentUser.id) { - return ; + return ; } else { - return ; + return ; } }, [currentUser.id] diff --git a/src/components/note/content/metadata.tsx b/src/components/note/content/metadata.tsx index b63c7055..5a533e4a 100644 --- a/src/components/note/content/metadata.tsx +++ b/src/components/note/content/metadata.tsx @@ -37,14 +37,11 @@ export default function NoteMetadata({ eventID, eventPubkey }: { eventID: string } }, undefined, - (events, relayURL) => { - console.log(events, relayURL); - }, + undefined, { unsubscribeOnEose: true, } ); - // eslint-disable-next-line react-hooks/exhaustive-deps }, [eventID, relayPool, relays]); return ( diff --git a/src/pages/newsfeed/following.tsx b/src/pages/newsfeed/following.tsx index b0a59068..903fcb99 100644 --- a/src/pages/newsfeed/following.tsx +++ b/src/pages/newsfeed/following.tsx @@ -72,11 +72,7 @@ export default function Page() { useEffect(() => { const getData = async () => { - const result = await db.select( - `SELECT * FROM cache_notes WHERE created_at <= ${dateToUnix(now.current)} ORDER BY created_at DESC LIMIT ${ - limit.current - }` - ); + const result = await db.select(`SELECT * FROM cache_notes ORDER BY created_at DESC LIMIT ${limit.current}`); if (result.length > 0) { setData(result); } else {