feat(未讀消息數據結構優化): 更新多個接口和數據結構,將unreadCount移入config對象中,並調整相關邏輯以支持新結構,提升代碼可讀性和維護性。
This commit is contained in:
@@ -143,7 +143,10 @@ export const useWeChatStore = create<WeChatState>()(
|
||||
set({ currentMessages: [], openTransmitModal: false });
|
||||
clearUnreadCount([contract.id]).then(() => {
|
||||
if (isExist) {
|
||||
updateChatSession({ ...contract, unreadCount: 0 });
|
||||
updateChatSession({
|
||||
...contract,
|
||||
config: { unreadCount: 0 },
|
||||
});
|
||||
} else {
|
||||
addChatSession(contract);
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ export const useWebSocketStore = createPersistStore<WebSocketState>(
|
||||
|
||||
set({
|
||||
messages: [...currentState.messages, newMessage],
|
||||
unreadCount: currentState.unreadCount + 1,
|
||||
unreadCount: currentState.config.unreadCount + 1,
|
||||
});
|
||||
//消息处理器
|
||||
msgManageCore(data);
|
||||
|
||||
Reference in New Issue
Block a user