From 1618d123c1a1f5e14fd3721c284def3dfe42ce66 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 19 Oct 2021 10:00:51 +0300 Subject: [PATCH] fixed fav issue --- .../work-list-replacement-roll.component.html | 4 ++-- .../work-list-replacement-roll.component.ts | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html index a58c5c60..b4f6e8cd 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html @@ -167,12 +167,12 @@

-
+
{{'replacementRoll, search-result' | translate}}

- +
diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index 99ec0032..f39e81c2 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -433,6 +433,7 @@ export class WorkListReplacementRollComponent implements OnInit { } selectedType; + counter=0; onChangeSelect(select) { let selectValue = select.detail.value; @@ -441,16 +442,17 @@ export class WorkListReplacementRollComponent implements OnInit { this.isFilter = true; this.selectedType = 1; this.listOfRealted = this.actionHistory; - if(this.favoriteUserList.length > 0){ + if(this.counter > 0) + { this.actionHistory.forEach((obj, i) => { - if(this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) { - this.actionHistory[i].IsFavorite = true; - }else{ - this.actionHistory[i].IsFavorite = false; - } - console.log(this.actionHistory); - }); + if(this.favoriteUserList.find(x => x['USER_NAME'] === obj.USER_NAME)) { + this.actionHistory[i].IsFavorite = true; + }else{ + this.actionHistory[i].IsFavorite = false; + } + }); } + this.counter = 1; } else if (selectValue === '4') { // if (this.favoriteUserList.length === 0 || this.favoriteUserList === undefined) { this.getFavruite();