From d50cef7bb350702e836ea824ce8c1e8773b37151 Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Sun, 7 Jul 2019 16:24:53 +0200 Subject: [PATCH] Repair reducer --- app/src/reducers/Charts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/reducers/Charts.ts b/app/src/reducers/Charts.ts index 1ec2fa8..5e68ffc 100644 --- a/app/src/reducers/Charts.ts +++ b/app/src/reducers/Charts.ts @@ -84,8 +84,9 @@ function moveUp(state: ChartsState, action: MoveUp) { const previousItem = charts.get(idx - 1) if (idx === 0 || !item || !previousItem) { - return + return state // do nothing } + const newlyOrderedCharts = charts.set(idx - 1, item).set(idx, previousItem) return state.set('charts', newlyOrderedCharts) }