fix build chat page
This commit is contained in:
@@ -24,29 +24,26 @@ export function Page() {
|
|||||||
]);
|
]);
|
||||||
const add = useChatMessages((state: any) => state.add);
|
const add = useChatMessages((state: any) => state.add);
|
||||||
|
|
||||||
useSWRSubscription(
|
useSWRSubscription(account !== pubkey ? ["chat", pubkey] : null, () => {
|
||||||
account.pubkey !== pubkey ? ["chat", pubkey] : null,
|
const unsubscribe = pool.subscribe(
|
||||||
() => {
|
[
|
||||||
const unsubscribe = pool.subscribe(
|
{
|
||||||
[
|
kinds: [4],
|
||||||
{
|
authors: [pubkey],
|
||||||
kinds: [4],
|
"#p": [account.pubkey],
|
||||||
authors: [pubkey],
|
since: dateToUnix(),
|
||||||
"#p": [account.pubkey],
|
|
||||||
since: dateToUnix(),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
READONLY_RELAYS,
|
|
||||||
(event: any) => {
|
|
||||||
add(account.pubkey, event);
|
|
||||||
},
|
},
|
||||||
);
|
],
|
||||||
|
READONLY_RELAYS,
|
||||||
|
(event: any) => {
|
||||||
|
add(account.pubkey, event);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
};
|
};
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchMessages(account.pubkey, pubkey);
|
fetchMessages(account.pubkey, pubkey);
|
||||||
|
|||||||
Reference in New Issue
Block a user