From 516063e07a99d34c8e8781c1808d3116795f2a12 Mon Sep 17 00:00:00 2001 From: brendan colloran Date: Wed, 13 Sep 2023 10:32:07 -0700 Subject: [PATCH] fix sort mapping --- web-common/src/features/dashboards/dashboard-stores.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web-common/src/features/dashboards/dashboard-stores.ts b/web-common/src/features/dashboards/dashboard-stores.ts index f5c00b481ee..ee309a6c751 100644 --- a/web-common/src/features/dashboards/dashboard-stores.ts +++ b/web-common/src/features/dashboards/dashboard-stores.ts @@ -512,7 +512,10 @@ const metricViewReducers = { switch (contextColumn) { case LeaderboardContextColumn.DELTA_ABSOLUTE: case LeaderboardContextColumn.DELTA_PERCENT: { + // if there is no time comparison, then we can't show + // these context columns, so return with no change if (metricsExplorer.showComparison === false) return; + metricsExplorer.leaderboardContextColumn = contextColumn; break; } @@ -686,7 +689,7 @@ function sortTypeForContextColumnType( const sortType = { [LeaderboardContextColumn.DELTA_PERCENT]: SortType.DELTA_PERCENT, [LeaderboardContextColumn.DELTA_ABSOLUTE]: SortType.DELTA_ABSOLUTE, - [LeaderboardContextColumn.PERCENT]: SortType.DELTA_ABSOLUTE, + [LeaderboardContextColumn.PERCENT]: SortType.PERCENT, [LeaderboardContextColumn.HIDDEN]: SortType.VALUE, }[contextCol];