fixed some performance issues

This commit is contained in:
Ren Amamiya
2023-04-21 15:13:33 +07:00
parent f8dff5f81e
commit 9fdf2eb81c
12 changed files with 71 additions and 62 deletions

View File

@@ -13,7 +13,7 @@ import { getEventHash, nip04, signEvent } from 'nostr-tools';
import { useCallback, useContext } from 'react';
export default function FormChat({ receiverPubkey }: { receiverPubkey: string }) {
const [pool, relays]: any = useContext(RelayContext);
const [pool]: any = useContext(RelayContext);
const [activeAccount]: any = useLocalStorage('account', {});
const [value, setValue] = useAtom(chatContentAtom);
@@ -44,7 +44,7 @@ export default function FormChat({ receiverPubkey }: { receiverPubkey: string })
resetValue();
})
.catch(console.error);
}, [encryptMessage, activeAccount.privkey, activeAccount.pubkey, receiverPubkey, pool]);
}, [encryptMessage, activeAccount.privkey, activeAccount.pubkey, receiverPubkey, resetValue, pool]);
const handleEnterPress = (e) => {
if (e.key === 'Enter' && !e.shiftKey) {