You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by yj...@apache.org on 2020/11/04 22:29:56 UTC

[incubator-superset] branch master updated: fix(dashboard): properly unset mountedTab in reducer (#11558)

This is an automated email from the ASF dual-hosted git repository.

yjc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ef7087a  fix(dashboard): properly unset mountedTab in  reducer (#11558)
ef7087a is described below

commit ef7087adb653dc30a61488ec9087cc2f6d619bd0
Author: David Aaron Suddjian <18...@users.noreply.github.com>
AuthorDate: Wed Nov 4 14:27:32 2020 -0800

    fix(dashboard): properly unset mountedTab in  reducer (#11558)
---
 superset-frontend/src/dashboard/reducers/dashboardState.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/superset-frontend/src/dashboard/reducers/dashboardState.js b/superset-frontend/src/dashboard/reducers/dashboardState.js
index c7fde4a..6a21dec 100644
--- a/superset-frontend/src/dashboard/reducers/dashboardState.js
+++ b/superset-frontend/src/dashboard/reducers/dashboardState.js
@@ -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