mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2024-11-28 21:18:54 +03:00
perf: reset selected torrents when changing filters (#712)
This commit is contained in:
parent
2c3afa5799
commit
b1b32127e8
1 changed files with 25 additions and 6 deletions
|
@ -85,12 +85,14 @@ import { mapGetters, mapState } from 'vuex'
|
|||
export default {
|
||||
name: 'FilterSelect',
|
||||
props: ['showTrackerFilter'],
|
||||
data: () => ({
|
||||
selectedState: null,
|
||||
selectedCategory: null,
|
||||
selectedTag: null,
|
||||
selectedTracker: null
|
||||
}),
|
||||
data() {
|
||||
return {
|
||||
selectedState: null,
|
||||
selectedCategory: null,
|
||||
selectedTag: null,
|
||||
selectedTracker: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['getCategories', 'getAvailableTags', 'getTrackers']),
|
||||
...mapState(['sort_options']),
|
||||
|
@ -155,6 +157,20 @@ export default {
|
|||
mounted() {
|
||||
this.loadFilter()
|
||||
},
|
||||
watch: {
|
||||
selectedState() {
|
||||
this.resetSelectedTorrents()
|
||||
},
|
||||
selectedCategory() {
|
||||
this.resetSelectedTorrents()
|
||||
},
|
||||
selectedTag() {
|
||||
this.resetSelectedTorrents()
|
||||
},
|
||||
selectedTracker() {
|
||||
this.resetSelectedTorrents()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
commitFilter() {
|
||||
this.$store.commit('UPDATE_SORT_OPTIONS', {
|
||||
|
@ -185,6 +201,9 @@ export default {
|
|||
setTracker(value) {
|
||||
this.selectedTracker = value
|
||||
this.commitFilter()
|
||||
},
|
||||
resetSelectedTorrents() {
|
||||
this.$store.commit('RESET_SELECTED')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue