From bc59e878198a5f01fc34c31be5610026c2932a30 Mon Sep 17 00:00:00 2001 From: Jakub Szpila Date: Mon, 25 Jul 2022 10:57:24 +0200 Subject: [PATCH 1/2] add check to skip reorder and delete --- .../[experimentId]/plots-and-tables/dot-plot/index.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx b/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx index ea3fe6f0df..bdbe7a9559 100644 --- a/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx +++ b/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx @@ -176,6 +176,8 @@ const DotPlotPage = (props) => { }; const reorderData = (order) => { + if (!plotData) return; + const cellSetsNames = [...new Set(plotData.map((elem) => elem.cellSets))]; const reorderedData = []; cellSetsNames.forEach((set) => { @@ -190,6 +192,8 @@ const DotPlotPage = (props) => { }; const deleteData = (genes) => { + if (!plotData) return; + const data = plotData.filter((elem) => !genes.includes(elem.geneName)); dispatch(updatePlotData(plotUuid, data)); }; From f0ed066312a53236b070e0fd4d7e44f62f0733bf Mon Sep 17 00:00:00 2001 From: Jakub Szpila Date: Mon, 25 Jul 2022 11:10:06 +0200 Subject: [PATCH 2/2] fix check to not reload selected genes when returning --- .../[experimentId]/plots-and-tables/dot-plot/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx b/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx index bdbe7a9559..4e05e1a2aa 100644 --- a/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx +++ b/src/pages/experiments/[experimentId]/plots-and-tables/dot-plot/index.jsx @@ -295,7 +295,7 @@ const DotPlotPage = (props) => { // load initial state, based on highest dispersion genes from all genes useEffect(() => { - if (_.isEmpty(geneData) || !config || plotData?.length) { + if (_.isEmpty(geneData) || !config || plotDataLoading) { return; } loadHighestDispersionGenes();