- async (dispatch: Dispatch) => {
- const collection = await dispatch<any>(loadCollectionPanel(uuid));
- await dispatch<any>(activateSidePanelTreeItem(collection.ownerUuid));
- dispatch<any>(setCollectionBreadcrumbs(collection.uuid));
- dispatch(loadDetailsPanel(uuid));
+ async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const userUuid = services.authService.getUuid();
+ if (userUuid) {
+ const match = await loadGroupContentsResource({ uuid, userUuid, services });
+ match({
+ OWNED: async collection => {
+ dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource));
+ dispatch(updateResources([collection]));
+ await dispatch(activateSidePanelTreeItem(collection.ownerUuid));
+ dispatch(setSidePanelBreadcrumbs(collection.ownerUuid));
+ dispatch(loadCollectionFiles(collection.uuid));
+ },
+ SHARED: collection => {
+ dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource));
+ dispatch(updateResources([collection]));
+ dispatch<any>(setSharedWithMeBreadcrumbs(collection.ownerUuid));
+ dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME));
+ dispatch(loadCollectionFiles(collection.uuid));
+ },
+ TRASHED: collection => {
+ dispatch(collectionPanelActions.SET_COLLECTION(collection as CollectionResource));
+ dispatch(updateResources([collection]));
+ dispatch(setTrashBreadcrumbs(''));
+ dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
+ dispatch(loadCollectionFiles(collection.uuid));
+ },
+
+ });
+ }