mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-02-18 00:02:02 +03:00
perf: reset pageNumber when changing filters to prevent value overflow (#591) @Larsluph
This commit is contained in:
parent
5132d4decf
commit
719c5e9eba
1 changed files with 5 additions and 0 deletions
|
@ -271,6 +271,11 @@ export default {
|
|||
watch: {
|
||||
torrents: function (torrents) {
|
||||
this.$store.commit('SET_CURRENT_ITEM_COUNT', torrents.length)
|
||||
|
||||
const pageCount = Math.ceil( torrents.length / this.paginationSize);
|
||||
if (pageCount < this.pageNumber) {
|
||||
this.pageNumber = Math.max(1, pageCount)
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
Loading…
Add table
Reference in a new issue