diff --git a/src/app/(agent)/agent/notifications/page.tsx b/src/app/(agent)/agent/notifications/page.tsx index b8825bc..2dcff69 100644 --- a/src/app/(agent)/agent/notifications/page.tsx +++ b/src/app/(agent)/agent/notifications/page.tsx @@ -49,7 +49,11 @@ export default function AgentNotificationsPage() { const data = await notificationsApiService.getNotifications(filter, 1, 50); setNotifications(data.notifications); setUnreadCount(data.unreadCount); - setTotalCount(data.pagination.total); + // Only update totalCount from the 'all' filter, otherwise it gets overwritten + // with the unread count when switching tabs + if (filter === 'all') { + setTotalCount(data.pagination.total); + } } catch (err) { console.error('Failed to fetch notifications:', err); } finally { diff --git a/src/app/(user)/user/notifications/page.tsx b/src/app/(user)/user/notifications/page.tsx index 9a648b7..2321d6f 100644 --- a/src/app/(user)/user/notifications/page.tsx +++ b/src/app/(user)/user/notifications/page.tsx @@ -47,7 +47,9 @@ export default function UserNotificationsPage() { const data = await notificationsApiService.getNotifications(filter, 1, 50); setNotifications(data.notifications); setUnreadCount(data.unreadCount); - setTotalCount(data.pagination.total); + if (filter === 'all') { + setTotalCount(data.pagination.total); + } } catch (err) { console.error('Failed to fetch notifications:', err); } finally {