From 8e4bef69d55a3faf247c58574067eba707ab53b0 Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Tue, 5 Sep 2023 00:30:03 +0300 Subject: [PATCH] fix: suites state with empty picked browsers --- lib/static/modules/reducers/tree/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/static/modules/reducers/tree/index.js b/lib/static/modules/reducers/tree/index.js index 0398b2660..595601160 100644 --- a/lib/static/modules/reducers/tree/index.js +++ b/lib/static/modules/reducers/tree/index.js @@ -1,4 +1,4 @@ -import {findLast} from 'lodash'; +import {findLast, isEmpty} from 'lodash'; import {produce} from 'immer'; import actionNames from '../../action-names'; import { @@ -43,8 +43,11 @@ export default ((state, action) => { case actionNames.BROWSERS_SELECTED: { const {tree, view} = state; + const filteredBrowsers = isEmpty(view.filteredBrowsers) + ? state.browsers.map(({id}) => ({id, versions: []})) + : view.filteredBrowsers; - updateAllSuitesStatus(tree, view.filteredBrowsers, diff.tree); + updateAllSuitesStatus(tree, filteredBrowsers, diff.tree); calcBrowsersShowness({tree, view, diff: diff.tree}); calcSuitesShowness({tree, diff: diff.tree});