@janovix/blocks 1.2.0-rc.12 → 1.2.0-rc.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5002,8 +5002,18 @@ function NotificationsWidget({
5002
5002
  setOptimisticReadIds((prev) => {
5003
5003
  const next = new Set(prev);
5004
5004
  let changed = false;
5005
+ const notificationIds = new Set(notifications.map((n) => n.id));
5005
5006
  prev.forEach((id) => {
5006
5007
  const notification = notifications.find((n) => n.id === id);
5008
+ if (!notificationIds.has(id)) {
5009
+ next.delete(id);
5010
+ changed = true;
5011
+ console.log(
5012
+ "[NotificationsWidget] Removing stale optimistic ID:",
5013
+ id
5014
+ );
5015
+ return;
5016
+ }
5007
5017
  if (notification?.read === true) {
5008
5018
  next.delete(id);
5009
5019
  changed = true;