clean up and fix errors
This commit is contained in:
@@ -47,20 +47,20 @@ export default function Page() {
|
||||
);
|
||||
|
||||
const initialData = useCallback(async () => {
|
||||
const result = await getNotes(dateToUnix(now.current), limit.current, offset.current);
|
||||
const result: any = await getNotes(dateToUnix(now.current), limit.current, offset.current);
|
||||
setData((data) => [...data, ...result]);
|
||||
}, [setData]);
|
||||
|
||||
const loadMore = useCallback(async () => {
|
||||
offset.current += limit.current;
|
||||
// query next page
|
||||
const result = await getNotes(dateToUnix(now.current), limit.current, offset.current);
|
||||
const result: any = await getNotes(dateToUnix(now.current), limit.current, offset.current);
|
||||
setData((data) => [...data, ...result]);
|
||||
}, [setData]);
|
||||
|
||||
const loadLatest = useCallback(async () => {
|
||||
// next query
|
||||
const result = await getLatestNotes(dateToUnix(now.current));
|
||||
const result: any = await getLatestNotes(dateToUnix(now.current));
|
||||
// update data
|
||||
setData((data) => [...result, ...data]);
|
||||
// hide newer trigger
|
||||
|
||||
@@ -36,9 +36,8 @@ export default function Page({ params }: { params: { privkey: string } }) {
|
||||
const unsubscribe = pool.subscribe(
|
||||
[
|
||||
{
|
||||
authors: [pubkey],
|
||||
kinds: [0, 3],
|
||||
since: 0,
|
||||
authors: [pubkey],
|
||||
},
|
||||
],
|
||||
relays,
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
getActiveAccount,
|
||||
getPlebs,
|
||||
} from '@utils/storage';
|
||||
import { getParentID, nip02ToArray } from '@utils/transform';
|
||||
import { getParentID } from '@utils/transform';
|
||||
|
||||
import LumeSymbol from '@assets/icons/Lume';
|
||||
|
||||
@@ -31,10 +31,11 @@ export default function Page() {
|
||||
const unsubscribe = useRef(null);
|
||||
|
||||
const fetchData = useCallback(
|
||||
async (account: { id: number; pubkey: string; chats: string[] }, follows: any) => {
|
||||
async (account: { id: number; pubkey: string; chats: string[] }, tags: any) => {
|
||||
const notes = await countTotalNotes();
|
||||
const channels = await countTotalChannels();
|
||||
const chats = account.chats?.length || 0;
|
||||
const follows = JSON.parse(tags);
|
||||
|
||||
const query = [];
|
||||
let since: number;
|
||||
@@ -47,7 +48,7 @@ export default function Page() {
|
||||
}
|
||||
query.push({
|
||||
kinds: [1, 6],
|
||||
authors: JSON.parse(follows),
|
||||
authors: follows,
|
||||
since: since,
|
||||
until: dateToUnix(now.current),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user