Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

fix: Notification auto-dismiss not working due to stale closure

Chris Sherwood6f0c829d3667
diff --git a/admin/inertia/providers/NotificationProvider.tsx b/admin/inertia/providers/NotificationProvider.tsx
index aa5d888e..a8314eaf 100644
--- a/admin/inertia/providers/NotificationProvider.tsx
+++ b/admin/inertia/providers/NotificationProvider.tsx
@@ -22,7 +22,7 @@ const NotificationsProvider = ({ children }: { children: React.ReactNode }) => {
}
const removeNotification = (id: string) => {
- setNotifications(notifications.filter((n) => n.id !== id))
+ setNotifications((prev) => prev.filter((n) => n.id !== id))
}
const removeAllNotifications = () => {