X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/66088cabf30c5291ad8894e7009d9c9af466c158..a65af8010388549eac616bde8224368ab944ff6b:/services/workbench2/src/store/public-favorites/public-favorites-actions.ts diff --git a/services/workbench2/src/store/public-favorites/public-favorites-actions.ts b/services/workbench2/src/store/public-favorites/public-favorites-actions.ts index 2d4539ada5..b9915dbdf1 100644 --- a/services/workbench2/src/store/public-favorites/public-favorites-actions.ts +++ b/services/workbench2/src/store/public-favorites/public-favorites-actions.ts @@ -9,6 +9,9 @@ import { checkPublicFavorite } from "./public-favorites-reducer"; import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions"; import { ServiceRepository } from "services/services"; import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions"; +import { addDisabledButton, removeDisabledButton } from "store/multiselect/multiselect-actions"; +import { ContextMenuActionNames } from "views-components/context-menu/context-menu-action-set"; +import { loadPublicFavoritesTree } from "store/side-panel-tree/side-panel-tree-actions"; export const publicFavoritesActions = unionize({ TOGGLE_PUBLIC_FAVORITE: ofType<{ resourceUuid: string }>(), @@ -21,6 +24,7 @@ export type PublicFavoritesAction = UnionOf; export const togglePublicFavorite = (resource: { uuid: string; name: string }) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise => { dispatch(progressIndicatorActions.START_WORKING("togglePublicFavorite")); + dispatch(addDisabledButton(ContextMenuActionNames.ADD_TO_PUBLIC_FAVORITES)) const uuidPrefix = getState().auth.config.uuidPrefix; const uuid = `${uuidPrefix}-j7d0g-publicfavorites`; dispatch(publicFavoritesActions.TOGGLE_PUBLIC_FAVORITE({ resourceUuid: resource.uuid })); @@ -47,7 +51,9 @@ export const togglePublicFavorite = (resource: { uuid: string; name: string }) = hideDuration: 2000, kind: SnackbarKind.SUCCESS })); + dispatch(removeDisabledButton(ContextMenuActionNames.ADD_TO_PUBLIC_FAVORITES)) dispatch(progressIndicatorActions.STOP_WORKING("togglePublicFavorite")); + dispatch(loadPublicFavoritesTree()) }) .catch((e: any) => { dispatch(progressIndicatorActions.STOP_WORKING("togglePublicFavorite"));