- handleFirstTimeLoad(async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- const workflow = await services.workflowService.get(uuid);
- if (workflow) {
- dispatch<any>(updateResources([workflow]));
- await dispatch<any>(
- activateSidePanelTreeItem(workflow.ownerUuid)
- );
- dispatch<any>(setWorkflowBreadcrumbs(uuid));
+ handleFirstTimeLoad(async (dispatch: Dispatch,
+ getState: () => RootState,
+ services: ServiceRepository) => {
+
+ const userUuid = getUserUuid(getState());
+ if (userUuid) {
+ const match = await loadGroupContentsResource({
+ uuid,
+ userUuid,
+ services,
+ });
+ match({
+ OWNED: (workflow) => {
+ dispatch(updateResources([workflow]));
+ dispatch<any>(activateSidePanelTreeItem(workflow.ownerUuid));
+ dispatch<any>(setSidePanelBreadcrumbs(workflow.ownerUuid));
+ },
+ SHARED: (workflow) => {
+ dispatch<any>(updateResources([workflow]));
+ dispatch<any>(activateSidePanelTreeItem(workflow.ownerUuid));
+ dispatch<any>(setSharedWithMeBreadcrumbs(workflow.ownerUuid));
+ },
+ TRASHED: () => { }
+ });