16848: Only request an extra token when needed.
[arvados-workbench2.git] / src / store / collections / collection-info-actions.ts
index b904da705cbf601e45589bbeaa0f09d8267da375..29dc6b879eb744693f7fcfd0bfa3087f647cbb87 100644 (file)
@@ -6,6 +6,7 @@ import { Dispatch } from "redux";
 import { RootState } from "~/store/store";
 import { ServiceRepository } from "~/services/services";
 import { dialogActions } from '~/store/dialog/dialog-actions';
+import { getNewExtraToken } from "../auth/auth-action";
 
 export const COLLECTION_WEBDAV_S3_DIALOG_NAME = 'collectionWebdavS3Dialog';
 
@@ -21,7 +22,8 @@ export interface WebDavS3InfoDialogData {
 }
 
 export const openWebDavS3InfoDialog = (uuid: string, activeTab?: number) =>
-    (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+    async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+        await dispatch<any>(getNewExtraToken(true));
         dispatch(dialogActions.OPEN_DIALOG({
             id: COLLECTION_WEBDAV_S3_DIALOG_NAME,
             data: {