added useDecryptMessage hook and updated chat messages

This commit is contained in:
Ren Amamiya
2023-04-16 12:45:17 +07:00
parent b778cf6198
commit a7e95fd18a
11 changed files with 108 additions and 61 deletions
+1 -5
View File
@@ -25,7 +25,6 @@ export default function EventCollector() {
const now = useRef(new Date());
const unsubscribe = useRef(null);
const unlisten = useRef(null);
const createFollowingPlebs = useCallback(
async (tags) => {
@@ -115,7 +114,7 @@ export default function EventCollector() {
}, [pool, relays, activeAccount.id, activeAccount.pubkey, follows, setHasNewerNote, createFollowingPlebs]);
const listenWindowClose = useCallback(async () => {
unlisten.current = window.getCurrent().listen(TauriEvent.WINDOW_CLOSE_REQUESTED, () => {
window.getCurrent().listen(TauriEvent.WINDOW_CLOSE_REQUESTED, () => {
writeStorage('lastLogin', now.current);
window.getCurrent().close();
});
@@ -129,9 +128,6 @@ export default function EventCollector() {
if (unsubscribe.current) {
unsubscribe.current();
}
if (unlisten.current) {
unlisten.current;
}
};
}, [setHasNewerNote, subscribe, listenWindowClose]);