From 426dbbd7a9175f50ec67863bdc81f11a6927512f Mon Sep 17 00:00:00 2001 From: Xiao Gui <xgui3783@gmail.com> Date: Wed, 18 Oct 2023 17:19:27 +0200 Subject: [PATCH] fix: lint and edge case issue --- src/state/atlasSelection/effects.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/state/atlasSelection/effects.ts b/src/state/atlasSelection/effects.ts index fdebec2b6..7cf228c21 100644 --- a/src/state/atlasSelection/effects.ts +++ b/src/state/atlasSelection/effects.ts @@ -85,21 +85,20 @@ export class Effect { return this.store.pipe( select(atlasSelection.selectors.navigation), take(1), - switchMap(({ position, ...rest }) => - + switchMap(navigation => /** * if either space name is undefined, return default state for navigation */ !prevSpcName || !currSpcName - ? of({ navigation: { position, ...rest } }) - : this.interSpaceCoordXformSvc.transform(prevSpcName, currSpcName, position as [number, number, number]).pipe( + ? of({ navigation }) + : this.interSpaceCoordXformSvc.transform(prevSpcName, currSpcName, navigation.position as [number, number, number]).pipe( map(value => { if (value.status === "error") { return {} } return { navigation: { - ...rest, + ...navigation, position: value.result, } } as Partial<AtlasSelectionState> @@ -206,7 +205,7 @@ export class Effect { fromRootStore.distinctATP() )), switchMap(([requestedPossibleATPs, { atlas, template, parcellation }]) => { - let result = DecisionCollapse.Intersect(...requestedPossibleATPs) + const result = DecisionCollapse.Intersect(...requestedPossibleATPs) const errorMessages = DecisionCollapse.Verify(result) if (errorMessages.length > 0) { -- GitLab