commit fd9ed97fdc60baaa3f74a3f7b02c6831c6d6948b
parent ae49194d4271f1108ec9b8318ea3b7977314cb85
Author: Sebastian <sebasjm@gmail.com>
Date: Mon, 25 Sep 2023 09:31:04 -0300
do not reuse the same map instance
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/web-util/src/hooks/useNotifications.ts b/packages/web-util/src/hooks/useNotifications.ts
@@ -53,7 +53,7 @@ export function useNotifications(): Notification[] {
useEffect(() => {
return storage.onUpdate(NOTIFICATION_KEY, () => {
const mem = storage.get(NOTIFICATION_KEY) ?? new Map();
- setter(mem);
+ setter(structuredClone(mem));
});
});