[PULSE-55] In-app notification center, settings tab, and notifications page #28

Merged
uz1mani merged 13 commits from staging into main 2026-02-16 19:46:02 +00:00
9 changed files with 736 additions and 725 deletions
Showing only changes of commit 56b99dfcef - Show all commits

View File

@@ -99,8 +99,8 @@ export default function NotificationsPage() {
setNotifications((prev) => prev.map((n) => ({ ...n, read: true })))
setUnreadCount(0)
toast.success('All notifications marked as read')
} catch {
toast.error(getAuthErrorMessage(new Error('Failed to mark all as read')))
} catch (err) {
toast.error(getAuthErrorMessage(err as Error) || 'Failed to mark all as read')
}
}

View File

@@ -1012,6 +1012,7 @@ export default function OrganizationSettings() {
aria-checked={notificationSettings[cat.id] !== false}
aria-label={`${notificationSettings[cat.id] !== false ? 'Disable' : 'Enable'} ${cat.label} notifications`}
onClick={() => {
const prev = { ...notificationSettings }
const next = { ...notificationSettings, [cat.id]: notificationSettings[cat.id] === false }
setNotificationSettings(next)
setIsSavingNotificationSettings(true)
@@ -1021,7 +1022,7 @@ export default function OrganizationSettings() {
})
.catch((err) => {
toast.error(getAuthErrorMessage(err) || 'Failed to update settings')
setNotificationSettings(notificationSettings)
setNotificationSettings(prev)
})
.finally(() => setIsSavingNotificationSettings(false))
}}