!163 jscrash of close\id\touchend

Merge pull request !163 from zhouhongli2023/master
This commit is contained in:
openharmony_ci 2024-11-19 08:18:37 +00:00 committed by Gitee
commit 8072d2bf01
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 16 additions and 11 deletions

View File

@ -1495,8 +1495,8 @@ export default class ConversationController {
let tempWeekId = item.week?.id;
if (list.length > 0) {
item.dateShow =
(tempDateId != (list[list.length-1]).date.id)
&& (tempWeekId != (list[list.length-1]).week.id)
(tempDateId != (list[list.length-1]).date?.id)
&& (tempWeekId != (list[list.length-1]).week?.id)
}
}

View File

@ -367,10 +367,12 @@ export default class ConversationListController {
}
touchEnd(event: GestureEvent, index: number) {
HiLog.i(TAG, 'touchEnd, index: ' + index);
if (this.isMultipleSelectState) {
return;
}
// offsetX indicates the offset. The value range is [-operateBtnW, 0].
try {
let offsetX = event.offsetX;
let item = this.messageList[this.itemTouchedIdx];
if (offsetX + (this.operateBtnW / 2) >= 0) {
@ -380,6 +382,9 @@ export default class ConversationListController {
this.setListItemTransX(0 - this.operateBtnW);
item.isDelShow = true;
}
} catch (error) {
HiLog.e(TAG, 'touchEnd: ' + JSON.stringify(error));
}
}
setListItemTransX(transX) {

View File

@ -112,7 +112,7 @@ export abstract class WorkerWrapper {
HiLog.i(TAG, `${this.getWorkerType()} worker close!`);
if (this.mWorker != null) {
HiLog.i(TAG, 'this mWorker is right');
this.mWorker.terminate();
this.mWorker?.terminate();
}
this.mWorker = null;
this.callBacks.clear();