build(config): update bundle identifier and add signing plugin
feat(notification): improve JPush integration and message sync reliability - Update iOS bundle identifier to `cn.qczlit.weiyou` - Add `withSigning` Expo plugin - Enhance `withJPush` plugin with improved Swift AppDelegate injection logic - Update JPush default channel to `developer-default` - Optimize `MessageSyncService` to prevent race conditions in unread count updates - Implement promise deduplication for `fetchUnreadCount` to prevent redundant network requests - Add `setConversationsWithUnread` to `useMessageStore` for atomic state updates of conversations and unread counts
This commit is contained in:
@@ -79,6 +79,11 @@ export interface MessageActions {
|
||||
|
||||
// 设置状态
|
||||
setConversations: (conversations: Map<string, ConversationResponse>) => void;
|
||||
setConversationsWithUnread: (
|
||||
conversations: Map<string, ConversationResponse>,
|
||||
totalUnread: number,
|
||||
systemUnread: number,
|
||||
) => void;
|
||||
updateConversation: (conversation: ConversationResponse) => void;
|
||||
removeConversation: (conversationId: string) => void;
|
||||
setMessages: (conversationId: string, messages: MessageResponse[]) => void;
|
||||
@@ -255,6 +260,27 @@ export const useMessageStore = create<MessageStore>((set, get) => ({
|
||||
}));
|
||||
},
|
||||
|
||||
setConversationsWithUnread: (
|
||||
conversations: Map<string, ConversationResponse>,
|
||||
totalUnread: number,
|
||||
systemUnread: number,
|
||||
) => {
|
||||
const conversationList = sortConversationList(conversations);
|
||||
const notificationMutedMap = new Map<string, boolean>();
|
||||
conversations.forEach((conv, id) => {
|
||||
if (conv.notification_muted) {
|
||||
notificationMutedMap.set(id, true);
|
||||
}
|
||||
});
|
||||
set(state => ({
|
||||
conversations,
|
||||
conversationList,
|
||||
notificationMutedMap: new Map([...state.notificationMutedMap, ...notificationMutedMap]),
|
||||
totalUnreadCount: totalUnread,
|
||||
systemUnreadCount: systemUnread,
|
||||
}));
|
||||
},
|
||||
|
||||
updateConversation: (conversation: ConversationResponse) => {
|
||||
const id = normalizeConversationId(conversation.id);
|
||||
set(state => {
|
||||
|
||||
Reference in New Issue
Block a user