LPXXX Angular Catalog Preferences Page user/berick/lpxxx-ang-cat-prefs
authorBill Erickson <berickxx@gmail.com>
Thu, 31 Oct 2019 22:00:43 +0000 (18:00 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 31 Oct 2019 22:00:43 +0000 (18:00 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/catalog/prefs.component.ts

index 4f923d0..12d6d2c 100644 (file)
@@ -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
+        }
     }
 }