From 846294fae5ea0e481609285ec7d14fca4b734efc Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Wed, 2 Aug 2023 14:30:00 -0700 Subject: [PATCH] albums: more refactor for metadata Signed-off-by: Varun Patil --- src/components/Metadata.vue | 13 ++++++++++++- src/components/Timeline.vue | 2 +- src/components/modal/AlbumPicker.vue | 4 +++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/Metadata.vue b/src/components/Metadata.vue index 31bbde9a..d31f80ed 100644 --- a/src/components/Metadata.vue +++ b/src/components/Metadata.vue @@ -2,7 +2,7 @@
{{ t('memories', 'Albums') }}
- +
{{ t('memories', 'Metadata') }}
@@ -74,6 +74,7 @@ import TagIcon from 'vue-material-design-icons/Tag.vue'; import * as utils from '../services/Utils'; import { API } from '../services/API'; +import router from '../router'; import type { IAlbum, IImageInfo, IPhoto } from '../types'; @@ -373,6 +374,16 @@ export default defineComponent({ return (this.albums = list); }, + openAlbum(album: IAlbum) { + router.push({ + name: 'albums', + params: { + name: album.name, + user: album.user, + }, + }); + }, + handleFileUpdated({ fileid }: { fileid: number }) { if (fileid && this.fileid === fileid) { this.update(this.fileid); diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index f5f168bc..415221b6 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -275,7 +275,7 @@ export default defineComponent({ } globalThis.mViewer.open(photo, this.list); - } else if (from?.hash?.startsWith('#v') && !to.hash?.startsWith('#v') && viewerIsOpen) { + } else if (!to.hash?.startsWith('#v') && viewerIsOpen) { // Close viewer globalThis.mViewer.close(); } diff --git a/src/components/modal/AlbumPicker.vue b/src/components/modal/AlbumPicker.vue index 79ab29d6..c5beade0 100644 --- a/src/components/modal/AlbumPicker.vue +++ b/src/components/modal/AlbumPicker.vue @@ -1,6 +1,6 @@