From 72c7dc9c49605907a54d66dfeb26b1bc4220e9fb Mon Sep 17 00:00:00 2001 From: heikomat Date: Sat, 15 Oct 2022 00:32:06 +0200 Subject: [PATCH] prevent unnecessary re-searches on unchanged filter after page restore --- frontend/src/page/album/photos.vue | 6 +++++- frontend/src/page/photos.vue | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/page/album/photos.vue b/frontend/src/page/album/photos.vue index 3e6fd2ee0..b2b66396b 100644 --- a/frontend/src/page/album/photos.vue +++ b/frontend/src/page/album/photos.vue @@ -122,7 +122,11 @@ export default { this.filter.camera = query['camera'] ? parseInt(query['camera']) : 0; this.filter.country = query['country'] ? query['country'] : ''; this.settings.view = this.viewType(); - this.lastFilter = {}; + + if (JSON.stringify(this.lastFilter) !== JSON.stringify(this.filter)) { + this.lastFilter = {}; + } + this.routeName = this.$route.name; if (this.uid !== this.$route.params.uid) { diff --git a/frontend/src/page/photos.vue b/frontend/src/page/photos.vue index 7311fd57e..51d405c0e 100644 --- a/frontend/src/page/photos.vue +++ b/frontend/src/page/photos.vue @@ -183,9 +183,10 @@ export default { const filterChanged = JSON.stringify(this.lastFilter) !== JSON.stringify(this.filter); if (filterChanged) { this.lastFilter = {}; - this.routeName = this.$route.name; - this.search(); } + + this.routeName = this.$route.name; + this.search(); } }, created() {