🐛 Fixes notification wrong bubble count

This commit is contained in:
LittleSheep 2025-06-20 01:33:32 +08:00
parent 75097ab6fc
commit cb991d1574

View File

@ -47,8 +47,9 @@ class NotificationUnreadCountNotifier
void _subscribeToWebSocket() { void _subscribeToWebSocket() {
final webSocketService = ref.read(websocketProvider); final webSocketService = ref.read(websocketProvider);
_subscription = webSocketService.dataStream.listen((packet) { _subscription = webSocketService.dataStream.listen((packet) {
if (packet.type == 'notifications.new') { if (packet.type == 'notifications.new' && packet.data != null) {
_incrementCounter(); final notification = SnNotification.fromJson(packet.data!);
if (notification.topic != 'messages.new') _incrementCounter();
} }
}); });
} }