Skip to content

Commit d7634c4

Browse files
committed
Collapse columns if selected collection is already part of path
1 parent 79b0ee4 commit d7634c4

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

client/src/components/CollectionsColumn.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const {
3636
canNavigate,
3737
levels,
3838
createNewUrlPath,
39-
fetchCollectionDetails,
4039
setCollectionActive,
4140
setMode,
4241
setPathToActiveCollection,
@@ -195,28 +194,13 @@ async function handleItemSelected(uuid: string): Promise<void> {
195194
return;
196195
}
197196
198-
const isAlreadySelectedInColumn: boolean =
199-
uuid === levels.value[props.index].activeCollection?.data.uuid;
197+
const isAlreadyActiveInEditPane: boolean = uuid === activeCollection.value.collection.data.uuid;
200198
201-
const isAlreadyActiveInEditPane: boolean =
202-
isAlreadySelectedInColumn && uuid === activeCollection.value.collection.data.uuid;
203-
204-
// Nothing happens, return;
199+
// Nothing happens, return
205200
if (isAlreadyActiveInEditPane) {
206201
return;
207202
}
208203
209-
// Only update collection in edit pane. Leave navigation path intact
210-
if (isAlreadySelectedInColumn) {
211-
const cao: CollectionAccessObject = await fetchCollectionDetails(uuid);
212-
213-
setPathToActiveCollection(levels.value.slice(0, props.index + 1).map(l => l.activeCollection));
214-
setCollectionActive(cao);
215-
216-
return;
217-
}
218-
219-
// Else, change URL and let the watcher handle the rest
220204
updateUrlPath(uuid, props.index);
221205
}
222206

0 commit comments

Comments
 (0)