diff --git a/src/component/reducer/actions/SpectrumsActions.ts b/src/component/reducer/actions/SpectrumsActions.ts index f6ec79cc6..19d726c44 100644 --- a/src/component/reducer/actions/SpectrumsActions.ts +++ b/src/component/reducer/actions/SpectrumsActions.ts @@ -369,8 +369,13 @@ function handleChangeActiveSpectrum( }); } - //set the active spectra - activeSpectra[activeTab] = newActiveSpectra; + if (newActiveSpectra.length > 0) { + //set the active spectra + activeSpectra[activeTab] = newActiveSpectra; + } else { + // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + delete activeSpectra[activeTab]; + } //check if the previous selected spectra contain FT const previousActiveSpectraHasFT = spectra?.some(