jscrash of close\id\touchend

Signed-off-by: zhouhongli2023 <zhouhongli5@huawei.com>
This commit is contained in:
zhouhongli2023 2024-11-19 15:05:24 +08:00
parent 048147e031
commit 1294e9fd62
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,18 +367,23 @@ 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].
let offsetX = event.offsetX;
let item = this.messageList[this.itemTouchedIdx];
if (offsetX + (this.operateBtnW / 2) >= 0) {
this.setListItemTransX(0);
item.isDelShow = false;
} else {
this.setListItemTransX(0 - this.operateBtnW);
item.isDelShow = true;
try {
let offsetX = event.offsetX;
let item = this.messageList[this.itemTouchedIdx];
if (offsetX + (this.operateBtnW / 2) >= 0) {
this.setListItemTransX(0);
item.isDelShow = false;
} else {
this.setListItemTransX(0 - this.operateBtnW);
item.isDelShow = true;
}
} catch (error) {
HiLog.e(TAG, 'touchEnd: ' + JSON.stringify(error));
}
}

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();