aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.ts
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-04-05 23:26:23 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-04-05 23:26:23 -0400
commit0fa67503787b0080c6d398a4d8239eeb469ac107 (patch)
treecdab898c9357a4abf4dad4b7509694e06a2e145f /ufund-ui/src/app/components/cupboard/cupboard.component.ts
parent1d4073c04aac11226fa3394ba84a745ed427d1cd (diff)
parent95798c2b81da7f950850a6bb3c5be28e0323d5ba (diff)
downloadJellySolutions-0fa67503787b0080c6d398a4d8239eeb469ac107.tar.gz
JellySolutions-0fa67503787b0080c6d398a4d8239eeb469ac107.tar.bz2
JellySolutions-0fa67503787b0080c6d398a4d8239eeb469ac107.zip
Merge remote-tracking branch 'origin/main'
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.ts')
-rw-r--r--ufund-ui/src/app/components/cupboard/cupboard.component.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts
index b03b77e..aca1397 100644
--- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts
+++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts
@@ -26,7 +26,7 @@ export class CupboardComponent implements OnInit {
needs: Need[] = [];
searchResults: Need[] = [];
sortMode: 'Ascending' | 'Descending' = 'Ascending'
- itemsPerPage = 5;
+ itemsPerPage = parseInt(localStorage.getItem('itemsPerPage') ?? '5') ?? 5;
currentSortAlgo = 'sortByPriority';
constructor(
@@ -135,6 +135,17 @@ export class CupboardComponent implements OnInit {
}
}
+ editItemsPerPage() {
+ if (this.itemsPerPage > this.searchResults.length) {
+ this.itemsPerPage = this.searchResults.length
+ }
+ if (this.itemsPerPage < 1) {
+ this.itemsPerPage = 1
+ }
+ localStorage.setItem('itemsPerPage', this.itemsPerPage.toString())
+ this.refresh();
+ }
+
protected readonly SortingAlgorithms = SortingAlgoArrays;
protected readonly Object = Object;
}