This commit is contained in:
Ren Amamiya
2023-03-21 13:00:32 +07:00
parent c1d818c69d
commit 3ad1fff4f8
5 changed files with 18 additions and 27 deletions

View File

@@ -45,7 +45,6 @@ export default function Page() {
},
[db, privkey, pubkey]
);
// save follows to database
const insertFollows = useCallback(
async (follows) => {
@@ -60,13 +59,13 @@ export default function Page() {
},
[db, pubkey]
);
// submit then redirect to home
const submit = () => {
router.push('/');
};
useEffect(() => {
relayPool.subscribe(
const unsubscribe = relayPool.subscribe(
[
{
authors: [pubkey],
@@ -89,6 +88,10 @@ export default function Page() {
console.log(events, relayURL);
}
);
return () => {
unsubscribe();
};
}, [insertAccount, insertFollows, pubkey, relayPool, relays]);
return (