prevent unnecessary re-searches on unchanged filter after page restore

This commit is contained in:
heikomat 2022-10-15 00:32:06 +02:00 committed by Michael Mayer
parent 1ac9be1b6f
commit 72c7dc9c49
2 changed files with 8 additions and 3 deletions

View file

@ -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) {

View file

@ -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() {