X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/0eaad7ee985d2534e030e2d2839392435c33bba2..0afc40ccf18f9909ef1bab6cd8a41350a9789610:/src/store/project-tree-picker/project-tree-picker-actions.ts diff --git a/src/store/project-tree-picker/project-tree-picker-actions.ts b/src/store/project-tree-picker/project-tree-picker-actions.ts index 31110175..d05e2dc7 100644 --- a/src/store/project-tree-picker/project-tree-picker-actions.ts +++ b/src/store/project-tree-picker/project-tree-picker-actions.ts @@ -4,22 +4,23 @@ import { Dispatch } from "redux"; import { RootState } from "~/store/store"; +import { getUserUuid } from "~/common/getuser"; import { ServiceRepository } from "~/services/services"; import { mockProjectResource } from "~/models/test-utils"; import { treePickerActions, receiveTreePickerProjectsData } from "~/store/tree-picker/tree-picker-actions"; import { TreePickerId } from '~/models/tree'; export const resetPickerProjectTree = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - dispatch(treePickerActions.RESET_TREE_PICKER({pickerId: TreePickerId.PROJECTS})); - dispatch(treePickerActions.RESET_TREE_PICKER({pickerId: TreePickerId.SHARED_WITH_ME})); - dispatch(treePickerActions.RESET_TREE_PICKER({pickerId: TreePickerId.FAVORITES})); + dispatch(treePickerActions.RESET_TREE_PICKER({ pickerId: TreePickerId.PROJECTS })); + dispatch(treePickerActions.RESET_TREE_PICKER({ pickerId: TreePickerId.SHARED_WITH_ME })); + dispatch(treePickerActions.RESET_TREE_PICKER({ pickerId: TreePickerId.FAVORITES })); dispatch(initPickerProjectTree()); }; export const initPickerProjectTree = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - const uuid = services.authService.getUuid(); - + const uuid = getUserUuid(getState()); + if (!uuid) { return; } dispatch(getPickerTreeProjects(uuid)); dispatch(getSharedWithMeProjectsPickerTree(uuid)); dispatch(getFavoritesProjectsPickerTree(uuid)); @@ -43,4 +44,4 @@ const getProjectsPickerTree = (uuid: string, kind: string) => { [mockProjectResource({ uuid, name: kind })], kind ); -}; \ No newline at end of file +};