15736: Don't redundantly load local config
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 5 Nov 2019 15:23:15 +0000 (10:23 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 5 Nov 2019 15:23:15 +0000 (10:23 -0500)
Somehow missed this in the last commit

src/store/auth/auth-action.ts

index bfec39be40fff276323226f14c89fc01027b62fe..e394d62dc3d227b0b885bcf0bbf541fe3956b669 100644 (file)
@@ -85,16 +85,18 @@ const init = (config: Config) => (dispatch: Dispatch, getState: () => RootState,
             if (err.response) {
                 // Bad token
                 if (err.response.status === 401) {
-                    logout()(dispatch, getState, services);
+                    dispatch<any>(logout());
                 }
             }
         });
     }
     Object.keys(config.remoteHosts).map((k) => {
-        Axios.get<ClusterConfigJSON>(getClusterConfigURL(config.remoteHosts[k]))
-            .then(response => {
-                dispatch(authActions.REMOTE_CLUSTER_CONFIG({ config: buildConfig(response.data) }));
-            });
+        if (k !== config.uuidPrefix) {
+            Axios.get<ClusterConfigJSON>(getClusterConfigURL(config.remoteHosts[k]))
+                .then(response => {
+                    dispatch(authActions.REMOTE_CLUSTER_CONFIG({ config: buildConfig(response.data) }));
+                });
+        }
     });
 };