💄 Improve performance and bugs

This commit is contained in:
2025-12-27 23:19:58 +08:00
parent a8430604f9
commit 411c71dae0
6 changed files with 166 additions and 40 deletions

View File

@@ -185,7 +185,9 @@ class NotificationListNotifier extends AsyncNotifier<List<SnNotification>>
.toList();
final unreadCount = notifications.where((n) => n.viewedAt == null).length;
ref.read(notificationUnreadCountProvider.notifier).decrement(unreadCount);
if (ref.mounted) {
ref.read(notificationUnreadCountProvider.notifier).decrement(unreadCount);
}
return notifications;
}