From 743946b9299372c8d72052a55200865e40828bb0 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 7 Feb 2021 14:24:47 -0800 Subject: [PATCH] Update column properties when restoring persisted state (cherry picked from commit 653db8290e0a7737348d911d322c4218c3b5b677) --- frontend/src/Store/Middleware/createPersistState.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/Store/Middleware/createPersistState.js b/frontend/src/Store/Middleware/createPersistState.js index 4a412c3e9..fb1e8d3df 100644 --- a/frontend/src/Store/Middleware/createPersistState.js +++ b/frontend/src/Store/Middleware/createPersistState.js @@ -32,10 +32,13 @@ function mergeColumns(path, initialState, persistedState, computedState) { // as long as they haven't been removed. persistedColumns.forEach((persistedColumn) => { - const columnIndex = initialColumns.findIndex((i) => i.name === persistedColumn.name); + const column = initialColumns.find((i) => i.name === persistedColumn.name); - if (columnIndex >= 0) { - columns.push({ ...persistedColumn }); + if (column) { + columns.push({ + ...column, + isVisible: persistedColumn.isVisible + }); } });