diff --git a/projects/common-map/src/fm-map/components/map/map.component.ts b/projects/common-map/src/fm-map/components/map/map.component.ts index cfe38b9..8f0e399 100644 --- a/projects/common-map/src/fm-map/components/map/map.component.ts +++ b/projects/common-map/src/fm-map/components/map/map.component.ts @@ -192,7 +192,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit { newQueryState = this.serializeService.deserialize(queryState); queryState = this.serializeService.serialize(newQueryState); } - queryStateChanged = this.serializeService.serialize(lastQueryState) != queryState; + queryStateChanged = this.serializeService.serialize(lastQueryState) != queryState || setStateCount==0; } let t =0; if(setStateCount==0) t=600; diff --git a/projects/common-map/src/fm-map/effects/map.effects.ts b/projects/common-map/src/fm-map/effects/map.effects.ts index ba77655..0ae0067 100644 --- a/projects/common-map/src/fm-map/effects/map.effects.ts +++ b/projects/common-map/src/fm-map/effects/map.effects.ts @@ -149,10 +149,11 @@ export class MapEffects { selectItem$: Observable = 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))))