If undefined collection, use item as relative url (#15806)

* If no undefined collection, use item as relative url

* Only navigate if item is set

* Added Gerard Lamusse (u12206050)

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
This commit is contained in:
Gerard Lamusse
2023-04-11 15:03:41 +02:00
committed by GitHub
parent a13c52f123
commit e66ee967f0
2 changed files with 10 additions and 5 deletions

View File

@@ -191,12 +191,16 @@ export default defineComponent({
}
function onRowClick({ item }: { item: Item; event: PointerEvent }) {
const collection = collectionsStore.getCollection(item.collection);
if (item.collection) {
const collection = collectionsStore.getCollection(item.collection);
if (collection?.meta?.singleton) {
router.push(`/content/${item.collection}`);
} else {
router.push(`/content/${item.collection}/${item.item}`);
if (collection?.meta?.singleton) {
router.push(`/content/${item.collection}`);
} else {
router.push(`/content/${item.collection}/${item.item}`);
}
} else if (String(item.item).startsWith('/')) {
router.push(item.item);
}
notificationsDrawerOpen.value = false;

View File

@@ -7,5 +7,6 @@
- bicouy0
- Nitwel
- azrikahar
- u12206050
- that1matt
- jaads