From e4ca6672c5d0e15de7b579cdbc6fe8ba033060d5 Mon Sep 17 00:00:00 2001 From: jorgenherje Date: Tue, 26 Sep 2023 11:35:11 +0200 Subject: [PATCH] Minor fixes after review --- .../SimulationTimeSeriesMatrix/settings.tsx | 28 +++++++++++-------- .../utils/ensemblesVectorListHelper.ts | 6 ++-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/modules/SimulationTimeSeriesMatrix/settings.tsx b/frontend/src/modules/SimulationTimeSeriesMatrix/settings.tsx index feaa5343e..7bd8d34b0 100644 --- a/frontend/src/modules/SimulationTimeSeriesMatrix/settings.tsx +++ b/frontend/src/modules/SimulationTimeSeriesMatrix/settings.tsx @@ -76,7 +76,6 @@ export function settings({ moduleContext, workbenchSession }: ModuleFCProps query.isLoading || query.isError); - if (!hasVectorListQueriesErrorOrLoading && !isEqual(currentVectorSelectorData, vectorSelectorData)) { + const hasVectorListQueriesErrorOrFetching = vectorListQueries.some((query) => query.isFetching || query.isError); + if (!hasVectorListQueriesErrorOrFetching && !isEqual(currentVectorSelectorData, vectorSelectorData)) { setVectorSelectorData(currentVectorSelectorData); } @@ -134,11 +133,17 @@ export function settings({ moduleContext, workbenchSession }: ModuleFCProps parameter.equals(newParameterIdent)) - ? setParameterIdent(newParameterIdent) - : setParameterIdent(null); + const isParameterInUnion = continuousAndNonConstantParametersUnion.some((parameter) => + parameter.equals(newParameterIdent) + ); + if (isParameterInUnion) { + setParameterIdent(newParameterIdent); + } else { + setParameterIdent(null); + } } catch { setParameterIdent(null); } @@ -300,12 +305,11 @@ export function settings({ moduleContext, workbenchSession }: ModuleFCProps
{ diff --git a/frontend/src/modules/SimulationTimeSeriesMatrix/utils/ensemblesVectorListHelper.ts b/frontend/src/modules/SimulationTimeSeriesMatrix/utils/ensemblesVectorListHelper.ts index c0bb2947d..c94644400 100644 --- a/frontend/src/modules/SimulationTimeSeriesMatrix/utils/ensemblesVectorListHelper.ts +++ b/frontend/src/modules/SimulationTimeSeriesMatrix/utils/ensemblesVectorListHelper.ts @@ -37,9 +37,9 @@ export class EnsembleVectorListsHelper { // Add vector if name is not already in vectorUnion for (const vector of query.data) { - if (!vectorUnion.some((v) => v === vector.name)) { - vectorUnion.push(vector.name); - } + if (vectorUnion.includes(vector.name)) continue; + + vectorUnion.push(vector.name); } } return vectorUnion;