LP1867834 Staffcat clear basket on logout
authorBill Erickson <berickxx@gmail.com>
Wed, 18 Mar 2020 16:41:38 +0000 (12:41 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Aug 2020 21:18:06 +0000 (17:18 -0400)
Tell the browser/local store service to treat the staff catalog basket
cache key as a "login item", meaning it should be cleared upon logout.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/share/catalog/basket.service.ts

index 0d97220..20fb491 100644 (file)
@@ -30,6 +30,9 @@ export class BasketService {
     ) {
         this.idList = [];
         this.onChange = new EventEmitter<number[]>();
+
+        // Tell the browser store service to clear the basket on logout.
+        this.store.addLoginSessionKey(BASKET_CACHE_KEY_COOKIE);
     }
 
     hasRecordId(id: number): boolean {