minor fixes

This commit is contained in:
Ren Amamiya
2023-03-19 17:32:00 +07:00
parent fe6d510e18
commit 1c9420f370
4 changed files with 5 additions and 14 deletions

View File

@@ -53,9 +53,7 @@ export const ActiveAccount = memo(function ActiveAccount({ user }: { user: any }
insertFollows(event.tags); insertFollows(event.tags);
}, },
undefined, undefined,
(events, relayURL) => { undefined,
console.log(events, relayURL);
},
{ {
unsubscribeOnEose: true, unsubscribeOnEose: true,
} }

View File

@@ -12,9 +12,9 @@ export default function AccountList() {
const renderAccount = useCallback( const renderAccount = useCallback(
(user: { id: string }) => { (user: { id: string }) => {
if (user.id === currentUser.id) { if (user.id === currentUser.id) {
return <ActiveAccount user={user} />; return <ActiveAccount key={user.id} user={user} />;
} else { } else {
return <InactiveAccount user={user} />; return <InactiveAccount key={user.id} user={user} />;
} }
}, },
[currentUser.id] [currentUser.id]

View File

@@ -37,14 +37,11 @@ export default function NoteMetadata({ eventID, eventPubkey }: { eventID: string
} }
}, },
undefined, undefined,
(events, relayURL) => { undefined,
console.log(events, relayURL);
},
{ {
unsubscribeOnEose: true, unsubscribeOnEose: true,
} }
); );
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [eventID, relayPool, relays]); }, [eventID, relayPool, relays]);
return ( return (

View File

@@ -72,11 +72,7 @@ export default function Page() {
useEffect(() => { useEffect(() => {
const getData = async () => { const getData = async () => {
const result = await db.select( const result = await db.select(`SELECT * FROM cache_notes ORDER BY created_at DESC LIMIT ${limit.current}`);
`SELECT * FROM cache_notes WHERE created_at <= ${dateToUnix(now.current)} ORDER BY created_at DESC LIMIT ${
limit.current
}`
);
if (result.length > 0) { if (result.length > 0) {
setData(result); setData(result);
} else { } else {