aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components/need-list/need-list.component.ts')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts11
1 files changed, 8 insertions, 3 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 2ec850e..ae6bc99 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
@@ -96,9 +96,14 @@ export class NeedListComponent {
this.updateVisibleNeeds()
}
- editNeedsPerPage(amount: number) {
- this.itemsPerPage = amount;
- this.updateVisibleNeeds();
+ editNeedsPerPage() {
+ if (this.itemsPerPage > this.searchResults.length) {
+ this.itemsPerPage = this.searchResults.length;
+ }
+ if (this.itemsPerPage < 1) {
+ this.itemsPerPage = 1;
+ }
+ this.resetVisibleNeeds();
}
updateVisibleNeeds() {