diff options
author | benal01 <bja4245@rit.edu> | 2025-04-05 13:18:30 -0400 |
---|---|---|
committer | benal01 <bja4245@rit.edu> | 2025-04-05 13:18:30 -0400 |
commit | 4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b (patch) | |
tree | 378e419d188f57820c0f54281ff3c996be86a6e4 | |
parent | 5186df87c75d83eb24a2cb5d868d8d0bb6aa5b88 (diff) | |
download | JellySolutions-4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b.tar.gz JellySolutions-4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b.tar.bz2 JellySolutions-4e59fe19150614b8a9b8033d50cb8a3e0ea1d13b.zip |
need items per page persistence
-rw-r--r-- | ufund-ui/src/app/components/need-list/need-list.component.ts | 3 |
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(); } |