Skip to content

Commit

Permalink
🐛 Fix the dataViews switch bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Aug 11, 2022
1 parent 07e3136 commit d317513
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions x-pack/plugins/lens/public/state_management/lens_slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,19 +374,20 @@ export const makeLensReducer = (storeDeps: LensStoreDeps) => {
.getTableSpec()
.map(({ columnId }) => columnId)
.filter((columnId) => !nextTable.has(columnId));
const nextVisState = (newState.visualization || state.visualization).state;
const activeVisualization = visualizationMap[state.visualization.activeId];
let nextVisState = (newState.visualization || state.visualization).state;
removed.forEach((columnId) => {
newState.visualization = {
...state.visualization,
state: activeVisualization.removeDimension({
layerId,
columnId,
prevState: nextVisState,
frame,
}),
};
nextVisState = activeVisualization.removeDimension({
layerId,
columnId,
prevState: nextVisState,
frame,
});
});
newState.visualization = {
...state.visualization,
state: nextVisState,
};
}
}
}
Expand Down

0 comments on commit d317513

Please sign in to comment.