Pārlūkot izejas kodu

Calculate pageCount on all passwords not filtered passwords

Fixes https://github.com/lesspass/lesspass/issues/693
tags/pure-v9.5.6
Guillaume Vincent pirms 2 gadiem
vecāks
revīzija
43a4c946b4
1 mainītis faili ar 11 papildinājumiem un 11 dzēšanām
  1. +11
    -11
      packages/lesspass-pure/src/views/Passwords.vue

+ 11
- 11
packages/lesspass-pure/src/views/Passwords.vue Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt