Browse Source

Calculate pageCount on all passwords not filtered passwords

Fixes https://github.com/lesspass/lesspass/issues/693
tags/pure-v9.5.6
Guillaume Vincent 2 years ago
parent
commit
43a4c946b4
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      packages/lesspass-pure/src/views/Passwords.vue

+ 11
- 11
packages/lesspass-pure/src/views/Passwords.vue View File

@@ -90,18 +90,18 @@ export default {
pagination: { pagination: {
pageCount: 1, pageCount: 1,
perPage: 5, perPage: 5,
currentPage: 1
}
currentPage: 1,
},
}; };
}, },
components: { components: {
PasswordProfile, PasswordProfile,
Paginate
Paginate,
}, },
computed: { computed: {
...mapState(["passwords"]), ...mapState(["passwords"]),
filteredPasswords() { filteredPasswords() {
const passwords = this.passwords.filter(password => {
const passwords = this.passwords.filter((password) => {
var loginMatch = password.login.match( var loginMatch = password.login.match(
new RegExp(this.searchQuery, "i") new RegExp(this.searchQuery, "i")
); );
@@ -113,17 +113,17 @@ export default {
this.pagination.perPage, this.pagination.perPage,
this.pagination.currentPage * this.pagination.perPage this.pagination.currentPage * this.pagination.perPage
); );
}
},
}, },
watch: { watch: {
filteredPasswords: { filteredPasswords: {
deep: true, deep: true,
handler: function(newVal) {
handler: function () {
this.pagination.pageCount = Math.ceil( this.pagination.pageCount = Math.ceil(
newVal.length / this.pagination.perPage
this.passwords.length / this.pagination.perPage
); );
}
}
},
},
}, },
beforeMount() { beforeMount() {
this.$store.dispatch("getPasswords"); this.$store.dispatch("getPasswords");
@@ -131,7 +131,7 @@ export default {
methods: { methods: {
setCurrentPage(page) { setCurrentPage(page) {
this.pagination.currentPage = page; this.pagination.currentPage = page;
}
}
},
},
}; };
</script> </script>

Loading…
Cancel
Save