Skip to content

Commit

Permalink
fix: suites state with empty picked browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovRoman committed Sep 4, 2023
1 parent 810892d commit 8e4bef6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/static/modules/reducers/tree/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {findLast} from 'lodash';
import {findLast, isEmpty} from 'lodash';
import {produce} from 'immer';
import actionNames from '../../action-names';
import {
Expand Down Expand Up @@ -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});

Expand Down

0 comments on commit 8e4bef6

Please sign in to comment.