You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/03/14 15:16:32 UTC

[GitHub] [incubator-superset] graceguo-supercat commented on a change in pull request #6964: [dashboard] direct link to single chart/tab/header in dashboard

graceguo-supercat commented on a change in pull request #6964: [dashboard] direct link to single chart/tab/header in dashboard
URL: https://github.com/apache/incubator-superset/pull/6964#discussion_r265620675
 
 

 ##########
 File path: superset/assets/src/dashboard/actions/dashboardState.js
 ##########
 @@ -134,19 +135,18 @@ export function saveDashboardRequestSuccess() {
 export function saveDashboardRequest(data, id, saveType) {
   const path = saveType === SAVE_TYPE_OVERWRITE ? 'save_dash' : 'copy_dash';
 
-  return dispatch =>
-    SupersetClient.post({
+  return dispatch => {
+    dispatch({ type: UPDATE_COMPONENTS_PARENTS_LIST });
 
 Review comment:
   `dispatch` is synchronous function, the dispatched action can be asynchronous, like returning a promise, so that we can chain actions after it. 
   https://stackoverflow.com/questions/43276291/is-store-dispatch-in-redux-synchronous-or-asynchronous
   
   The action `{ type: UPDATE_COMPONENTS_PARENTS_LIST }` is synchronous. Browser will always run this action first, then do post. (so that no need to chain in Promise object)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org