Skip to content

Commit

Permalink
Merge remote-tracking branch 'rubenthoms/new-2d-viewer' into new-2d-v…
Browse files Browse the repository at this point in the history
…iewer
  • Loading branch information
rubenthoms committed Oct 16, 2024
2 parents f589b86 + b931aba commit db2518b
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ export class StatisticalSurfaceLayer
.getRealizationFilterSet()
.getRealizationFilterForEnsembleIdent(ensembleIdent)
.getFilteredRealizations();
const currentEnsemble = workbenchSession.getEnsembleSet().findEnsemble(ensembleIdent);

// If sensitivity is set, filter realizations further to only include the realizations that are in the sensitivity
if (sensitivityNameCasePair) {
const currentEnsemble = workbenchSession.getEnsembleSet().findEnsemble(ensembleIdent);

const sensitivity = currentEnsemble
?.getSensitivities()
?.getCaseByName(sensitivityNameCasePair.sensitivityName, sensitivityNameCasePair.sensitivityCase);
Expand All @@ -105,7 +104,12 @@ export class StatisticalSurfaceLayer
sensitivityRealizations.includes(realization)
);
}
addrBuilder.withStatisticRealizations(filteredRealizations.map((realization) => realization));

// If realizations are filtered, update the address
let allRealizations = currentEnsemble?.getRealizations() ?? [];

Check failure on line 109 in frontend/src/modules/2DViewer/layers/implementations/layers/StatisticalSurfaceLayer/StatisticalSurfaceLayer.ts

View workflow job for this annotation

GitHub Actions / frontend

'allRealizations' is never reassigned. Use 'const' instead
if (!isEqual([...allRealizations], [...filteredRealizations])) {
addrBuilder.withStatisticRealizations([...filteredRealizations]);
}

if (timeOrInterval !== SurfaceTimeType_api.NO_TIME) {
addrBuilder.withTimeOrInterval(timeOrInterval);
Expand Down

0 comments on commit db2518b

Please sign in to comment.