fix(ws): only process unread notifications and handle multiple payload formats
Previously, the notification handler would process all notifications regardless of read status, and only accepted `extra_data` from the payload. Now it: - Only calls systemNotificationService and increments unread count for unread notifications - Falls back to `payload.extra` or `payload.data` when `extra_data` is not present
This commit is contained in:
@@ -131,9 +131,10 @@ export class WSMessageHandler implements IWSMessageHandler {
|
||||
|
||||
// 监听系统通知,实时更新系统未读数
|
||||
wsService.on('notification', (message: WSNotificationMessage) => {
|
||||
if (!message.is_read) {
|
||||
this.incrementSystemUnread();
|
||||
if (message.is_read) {
|
||||
return;
|
||||
}
|
||||
this.incrementSystemUnread();
|
||||
if (message.created_at) {
|
||||
const store = useMessageStore.getState();
|
||||
const currentLast = store.lastSystemMessageAt;
|
||||
|
||||
Reference in New Issue
Block a user