From 5668e54a55d365e88746b6a2ed03208e7612c113 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 6 May 2023 21:36:04 -0700 Subject: [PATCH] modal: fix album/face edit routes Signed-off-by: Varun Patil --- src/components/modal/AlbumCreateModal.vue | 8 +++++++- src/components/modal/FaceEditModal.vue | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/modal/AlbumCreateModal.vue b/src/components/modal/AlbumCreateModal.vue index 83d6b041..2632b287 100644 --- a/src/components/modal/AlbumCreateModal.vue +++ b/src/components/modal/AlbumCreateModal.vue @@ -66,7 +66,13 @@ export default defineComponent({ if (!this.album || album.basename !== this.album.basename) { const user = album.filename.split('/')[2]; const name = album.basename; - this.$router.push({ name: 'albums', params: { user, name } }); + const route = { name: 'albums', params: { user, name } }; + + if (!this.album) { + this.$router.push(route); + } else { + this.$router.replace(route); + } } this.close(); }, diff --git a/src/components/modal/FaceEditModal.vue b/src/components/modal/FaceEditModal.vue index a1c687af..0e0bb49f 100644 --- a/src/components/modal/FaceEditModal.vue +++ b/src/components/modal/FaceEditModal.vue @@ -93,7 +93,7 @@ export default defineComponent({ } else { await dav.faceRecognitionRenamePerson(this.oldName, this.name); } - this.$router.push({ + this.$router.replace({ name: this.$route.name as string, params: { user: this.user, name: this.name }, });