diff --git a/entry/src/main/ets/pages/conversation/conversationController.ets b/entry/src/main/ets/pages/conversation/conversationController.ets index 01622ae..312091a 100644 --- a/entry/src/main/ets/pages/conversation/conversationController.ets +++ b/entry/src/main/ets/pages/conversation/conversationController.ets @@ -1340,8 +1340,12 @@ export default class ConversationController { return; } if (initData.telephone == telephone) { - if (initData.id == undefined || initData.id == null) { - return; + try { + if (initData.id == undefined || initData.id == null) { + return; + } + } catch(err) { + HiLog.e(TAG, 'this initData.id is undefined ' + JSON.stringify(err)); } return initData.id; } diff --git a/entry/src/main/ets/pages/conversationlist/conversationListController.ets b/entry/src/main/ets/pages/conversationlist/conversationListController.ets index 8dbcbbf..258571b 100644 --- a/entry/src/main/ets/pages/conversationlist/conversationListController.ets +++ b/entry/src/main/ets/pages/conversationlist/conversationListController.ets @@ -136,6 +136,7 @@ export default class ConversationListController { delItem: number; // conversation list adapters conversationListDataSource: ConversationListDataSource = new ConversationListDataSource(); + private checkedStatus: Set = new Set(); static getInstance() { if (ConversationCtrl == null) { @@ -211,20 +212,29 @@ export default class ConversationListController { } // Touch and hold a list to display the selection and deletion functions. - conversationLongPress(index) { - // Check whether the left slide button exists. If yes, the button cannot be clicked. - if (this.messageList[index].isDelShow) { - return; + conversationLongPress(index : number) { + if (this.messageList[index]) { + // Check whether the left slide button exists. If yes, the button cannot be clicked. + if (this.messageList[index]?.isDelShow != null && this.messageList[index].isDelShow) { + return; + } + // Touch and hold a list to display the selection and deletion functions. + HiLog.i(TAG, 'conversationLongPress, index: ' + index); + let oldStates = this.messageList[index].isCbChecked; + if (this.isMultipleSelectState) { + this.messageList[index].isCbChecked = !this.messageList[index].isCbChecked; + } else { + this.messageList[index].isCbChecked = true; + this.isMultipleSelectState = true; + } + if (this.messageList[index].isCbChecked != oldStates && this.messageList[index].isCbChecked == true) { + this.conversationSelectedNumber = 1; + this.checkedStatus.clear(); + this.checkedStatus.add(index); + } + this.conversationListDataSource.notifyDataChange(index); + this.setConversationCheckAll(common.int.CHECKBOX_SELECT_UNKNOWN); } - // Touch and hold a list to display the selection and deletion functions. - HiLog.i(TAG, 'conversationLongPress, index: ' + index); - if (this.isMultipleSelectState) { - this.messageList[index].isCbChecked = !this.messageList[index].isCbChecked; - } else { - this.isMultipleSelectState = true; - this.messageList[index].isCbChecked = true; - } - this.setConversationCheckAll(common.int.CHECKBOX_SELECT_UNKNOWN); } setConversationCheckAll(selectType) { diff --git a/entry/src/main/ets/service/NotificationService.ets b/entry/src/main/ets/service/NotificationService.ets index bae49a7..567e324 100644 --- a/entry/src/main/ets/service/NotificationService.ets +++ b/entry/src/main/ets/service/NotificationService.ets @@ -114,7 +114,7 @@ export default class NotificationService { text: message.text }, }, - wantAgent: '', + wantAgent: undefined, slotType: Notification.SlotType.OTHER_TYPES, deliveryTime: new Date().getTime(), groupName: 'MMS'