Fix AW-1056, AW-1080
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma
2020-03-26 14:29:18 +01:00
parent 8db1edb262
commit bc17f80050
2 changed files with 4 additions and 3 deletions

View File

@@ -149,10 +149,11 @@ export class MapEffects {
selectItem$: Observable<Action> = this.actions$.pipe(
ofType(mapActions.SELECTITEM),
withLatestFrom(this.store$.select(mapReducers.selectGetSelectedItem)),
switchMap(([action, selectedItem]) => {
withLatestFrom(this.store$.select(mapReducers.getSetStateCount)),
switchMap(([[action, selectedItem],setStateCount]) => {
let a = action as mapActions.SelectItem;
let itemCode = selectedItem ? selectedItem.code : "";
if (a.itemCode != itemCode) {
if (a.itemCode != itemCode || setStateCount == 1) {
return this.itemService$.getItem(a.itemCode).pipe(
map((item: IItem) => new mapActions.SelectItemSuccess(item)),
catchError(error => of(new commonActions.Fail(error))))