fix(sql lab): MultiSelector component render twice (#20706)

* fix(sql lab): MultiSelector component render twice

* filter null/undefined tables
This commit is contained in:
Diego Medina
2022-07-19 08:33:15 -03:00
committed by GitHub
parent e60083b45b
commit 115ab700df
6 changed files with 43 additions and 17 deletions

View File

@@ -175,8 +175,12 @@ export default function sqlLabReducer(state = {}, action) {
[actions.COLLAPSE_TABLE]() {
return alterInArr(state, 'tables', action.table, { expanded: false });
},
[actions.REMOVE_TABLE]() {
return removeFromArr(state, 'tables', action.table);
[actions.REMOVE_TABLES]() {
const tableIds = action.tables.map(table => table.id);
return {
...state,
tables: state.tables.filter(table => !tableIds.includes(table.id)),
};
},
[actions.START_QUERY_VALIDATION]() {
let newState = { ...state };