- if (userUuid) {
- const match = await loadGroupContentsResource({
- uuid,
- userUuid,
- services,
- });
- let collection: CollectionResource | undefined;
- let breadcrumbfunc:
- | ((uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>)
- | undefined;
- let sidepanel: string | undefined;
- match({
- OWNED: thecollection => {
- collection = thecollection as CollectionResource;
- sidepanel = collection.ownerUuid;
- breadcrumbfunc = setSidePanelBreadcrumbs;
- },
- SHARED: thecollection => {
- collection = thecollection as CollectionResource;
- sidepanel = collection.ownerUuid;
- breadcrumbfunc = setSharedWithMeBreadcrumbs;
- },
- TRASHED: thecollection => {
- collection = thecollection as CollectionResource;
- sidepanel = SidePanelTreeCategory.TRASH;
- breadcrumbfunc = () => setTrashBreadcrumbs("");
- },
- });
- if (collection && breadcrumbfunc && sidepanel) {
- dispatch(updateResources([collection]));
- await dispatch<any>(finishLoadingProject(collection.ownerUuid));
- dispatch(collectionPanelActions.SET_COLLECTION(collection));
- await dispatch(activateSidePanelTreeItem(sidepanel));
- dispatch(breadcrumbfunc(collection.ownerUuid));
- dispatch(loadCollectionPanel(collection.uuid));
+ try {
+ dispatch(progressIndicatorActions.START_WORKING(uuid));
+ if (userUuid) {
+ const match = await loadGroupContentsResource({
+ uuid,
+ userUuid,
+ services,
+ });
+ let collection: CollectionResource | undefined;
+ let breadcrumbfunc:
+ | ((uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => Promise<void>)
+ | undefined;
+ let sidepanel: string | undefined;
+ match({
+ OWNED: thecollection => {
+ collection = thecollection as CollectionResource;
+ sidepanel = collection.ownerUuid;
+ breadcrumbfunc = setSidePanelBreadcrumbs;
+ },
+ SHARED: thecollection => {
+ collection = thecollection as CollectionResource;
+ sidepanel = collection.ownerUuid;
+ breadcrumbfunc = setSharedWithMeBreadcrumbs;
+ },
+ TRASHED: thecollection => {
+ collection = thecollection as CollectionResource;
+ sidepanel = SidePanelTreeCategory.TRASH;
+ breadcrumbfunc = () => setTrashBreadcrumbs("");
+ },
+ });
+ if (collection && breadcrumbfunc && sidepanel) {
+ dispatch(updateResources([collection]));
+ await dispatch<any>(finishLoadingProject(collection.ownerUuid));
+ dispatch(collectionPanelActions.SET_COLLECTION(collection));
+ await dispatch(activateSidePanelTreeItem(sidepanel));
+ dispatch(breadcrumbfunc(collection.ownerUuid));
+ dispatch(loadCollectionPanel(collection.uuid));
+ }