@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.cjs CHANGED
@@ -5030,8 +5030,18 @@ function NotificationsWidget({
5030
5030
  setOptimisticReadIds((prev) => {
5031
5031
  const next = new Set(prev);
5032
5032
  let changed = false;
5033
+ const notificationIds = new Set(notifications.map((n) => n.id));
5033
5034
  prev.forEach((id) => {
5034
5035
  const notification = notifications.find((n) => n.id === id);
5036
+ if (!notificationIds.has(id)) {
5037
+ next.delete(id);
5038
+ changed = true;
5039
+ console.log(
5040
+ "[NotificationsWidget] Removing stale optimistic ID:",
5041
+ id
5042
+ );
5043
+ return;
5044
+ }
5035
5045
  if (notification?.read === true) {
5036
5046
  next.delete(id);
5037
5047
  changed = true;