Skip to content

Commit 2f2de1f

Browse files
fix: reset activeSpectra and selectReferences state before load
1 parent c95d83a commit 2f2de1f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/component/reducer/actions/LoadAction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ function setData(draft: Draft<State>, input: InputProps | InitiateProps) {
131131
const defaultViewState = getDefaultViewState();
132132
// TODO: Refactor to find the spectrum index in each call rather than saving it in state.
133133
// For now, we will clear the activeSpectra and selectReferences
134-
view.spectra.activeSpectra = {};
135-
view.spectra.selectReferences = {};
136-
draft.view = lodashMerge(defaultViewState, view);
134+
draft.view = lodashMerge(defaultViewState, view, {
135+
spectra: { activeSpectra: {}, selectReferences: {} },
136+
});
137137
}
138138

139139
if (sources && sources.length > 0) {

0 commit comments

Comments
 (0)