13494: Forces version list retrieval when details panel is toggled on.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 13 Nov 2020 19:54:35 +0000 (16:54 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 13 Nov 2020 19:54:35 +0000 (16:54 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

src/store/details-panel/details-panel-action.ts

index cbce4210e5b055cb55217ae68a395305bc805342..5d3133caee6e8f84516d689515fc648ec402eee2 100644 (file)
@@ -112,11 +112,14 @@ export const createProjectProperty = (data: TagProperty) =>
             dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.errors[0], hideDuration: 2000, kind: SnackbarKind.ERROR }));
         }
     };
-export const toggleDetailsPanel = () => (dispatch: Dispatch) => {
+export const toggleDetailsPanel = () => (dispatch: Dispatch, getState: () => RootState) => {
     // because of material-ui issue resizing details panel breaks tabs.
     // triggering window resize event fixes that.
     setTimeout(() => {
         window.dispatchEvent(new Event('resize'));
     }, SLIDE_TIMEOUT);
     dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
+    if (getState().detailsPanel.isOpened) {
+        dispatch<any>(loadDetailsPanel(getState().detailsPanel.resourceUuid));
+    }
 };