aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-04-05 13:18:30 -0400
committerbenal01 <bja4245@rit.edu>2025-04-05 13:18:30 -0400
commit4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b (patch)
tree378e419d188f57820c0f54281ff3c996be86a6e4 /ufund-ui
parent5186df87c75d83eb24a2cb5d868d8d0bb6aa5b88 (diff)
downloadJellySolutions-4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b.tar.gz
JellySolutions-4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b.tar.bz2
JellySolutions-4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b.zip
need items per page persistence
Diffstat (limited to 'ufund-ui')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts
index 39ff538..ca92eeb 100644
--- a/ufund-ui/src/app/components/need-list/need-list.component.ts
+++ b/ufund-ui/src/app/components/need-list/need-list.component.ts
@@ -69,7 +69,7 @@ export class NeedListComponent {
visibleNeeds: Need[] = [];
sortMode: 'Ascending' | 'Descending' = 'Ascending'
currentPage: number = localStorage.getItem('currentPage') ? parseInt(localStorage.getItem('currentPage')!) : 0;
- itemsPerPage: number = 5;
+ itemsPerPage: number = localStorage.getItem('itemsPerPage') ? parseInt(localStorage.getItem('itemsPerPage')!) : 5;
totalPages: number = Math.ceil(this.needs.length / this.itemsPerPage);
getPrefix(need: Need) {
@@ -110,6 +110,7 @@ export class NeedListComponent {
if (this.itemsPerPage < 1) {
this.itemsPerPage = 1;
}
+ localStorage.setItem('itemsPerPage', this.itemsPerPage.toString());
this.resetVisibleNeeds();
}