From 1fac0d4bcc60df34bc1b8821bb77f906a262e5ae Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 31 Oct 2019 18:00:43 -0400 Subject: [PATCH] LPXXX Angular Catalog Preferences Page Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/staff/catalog/prefs.component.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/prefs.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/prefs.component.ts index 4f923d0da1..12d6d2cd5e 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/prefs.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/prefs.component.ts @@ -68,9 +68,15 @@ export class PreferencesComponent implements OnInit { countChanged() { const value: number = this.settings['eg.catalog.results.count']; - this.store.setItem('eg.catalog.results.count', value) - .then(_ => this.toast.success(this.successMsg.text)) - .then(_ => this.staffCat.searchContext.pager.limit = value); + if (value) { + this.store.setItem('eg.catalog.results.count', value) + .then(_ => this.toast.success(this.successMsg.text)) + .then(_ => this.staffCat.searchContext.pager.limit = value); + } else { + this.store.removeItem('eg.catalog.results.count') + .then(_ => this.toast.success(this.successMsg.text)) + .then(_ => this.staffCat.searchContext.pager.limit = 20); // default + } } } -- 2.11.0