fix: only decrypt blocklist when newer event received
This commit is contained in:
parent
86043e813f
commit
e058e7a28c
@ -20,7 +20,7 @@ import useModeration from "Hooks/useModeration";
|
||||
*/
|
||||
export default function useLoginFeed() {
|
||||
const dispatch = useDispatch();
|
||||
const { publicKey: pubKey, privateKey: privKey } = useSelector((s: RootState) => s.login);
|
||||
const { publicKey: pubKey, privateKey: privKey, latestMuted } = useSelector((s: RootState) => s.login);
|
||||
const { isMuted } = useModeration();
|
||||
const db = useDb();
|
||||
|
||||
@ -132,7 +132,7 @@ export default function useLoginFeed() {
|
||||
dispatch(setMuted(muted))
|
||||
|
||||
const newest = getNewest(mutedFeed.store.notes)
|
||||
if (newest && newest.content.length > 0 && pubKey) {
|
||||
if (newest && newest.content.length > 0 && pubKey && newest.created_at > latestMuted) {
|
||||
decryptBlocked(newest, pubKey, privKey).then((plaintext) => {
|
||||
try {
|
||||
const blocked = JSON.parse(plaintext)
|
||||
|
Loading…
x
Reference in New Issue
Block a user