fix(dashboard): properly unset mountedTab in reducer (#11558)

This commit is contained in:
David Aaron Suddjian 2020-11-04 14:27:32 -08:00 committed by GitHub
parent d999802795
commit ef7087adb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -124,13 +124,16 @@ export default function dashboardStateReducer(state = {}, action) {
};
},
[SET_DIRECT_PATH]() {
return {
const newState = {
...state,
// change of direct path (tabs) will reset current mounted tab
mountedTab: null,
directPathToChild: action.path,
directPathLastUpdated: Date.now(),
};
// change of direct path (tabs) will reset current mounted tab
// cannot just set mountedTab to null,
// as that is used when transitioning between tabs.
delete newState.mountedTab;
return newState;
},
[SET_MOUNTED_TAB]() {
// set current mounted tab after tab is really mounted to DOM