Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(notifications): commit a pending clear before the next, and clear locally up to the same cutoff

mantrandev8fdc6d0185ef
diff --git a/src/components/NotificationsPanel.tsx b/src/components/NotificationsPanel.tsx
index a695d331bf..afba19c4aa 100644
--- a/src/components/NotificationsPanel.tsx
+++ b/src/components/NotificationsPanel.tsx
@@ -167,8 +167,10 @@ export function NotificationsPanel() {
const clearAll = () => {
const cleared = state.notifications;
if (cleared.length === 0) return;
- pendingClear.current = Date.now();
- dispatch({ type: "notificationsCleared" });
+ commitClear();
+ const before = Math.max(...cleared.map((entry) => entry.at)) + 1;
+ pendingClear.current = before;
+ dispatch({ type: "notificationsCleared", before });
setToast({
text: t("notifications.cleared"),
undo: () => {