!166 删除通知列表循环优化

Merge pull request !166 from lijinfengde123/master
This commit is contained in:
openharmony_ci 2022-06-17 12:14:37 +00:00 committed by Gitee
commit 4bc4e33215
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -229,13 +229,12 @@ export class ViewModel {
removeGroupNotification(itemData, isDelSysConent) {
Log.showInfo(TAG, `removeGroupNotification, groupName: ${itemData.groupName}`);
let groupName = itemData.groupName;
let index = this.mNotificationList.length;
while (i--) {
for (let i = this.mNotificationList.length - 1; i >= 0; i--) {
if (this.mNotificationList[i].groupName == groupName) {
let id = this.mNotificationList[i].id
let hashcode = this.mNotificationList[i].hashcode
let removeItemArr = this.mNotificationList.splice(i, 1);
Log.showInfo(TAG, `removeGroupNotification i = ${i} removeItemArr= ${JSON.stringify(removeItemArr)}`);
Log.showDebug(TAG, `removeGroupNotification i = ${i} removeItemArr= ${JSON.stringify(removeItemArr)}`);
if (!CheckEmptyUtils.isEmpty(removeItemArr)) {
this.updateFlowControlInfos(removeItemArr[0].bundleName, false)
}
@ -293,7 +292,7 @@ export class ViewModel {
}
this.mNotificationCtrl['app'].set(item.bundleName, tmp);
}
Log.showInfo(TAG, 'initFlowControlInfos end, mNotificationCtrl: ' + JSON.stringify(this.mNotificationCtrl));
Log.showDebug(TAG, 'initFlowControlInfos end, mNotificationCtrl: ' + JSON.stringify(this.mNotificationCtrl));
}
isCanShow(bundleName: string): boolean {