From cefeb320e3014cf6fac6d8d9107da21258cb2342 Mon Sep 17 00:00:00 2001 From: kj1352 Date: Thu, 15 Oct 2020 17:48:55 +0530 Subject: [PATCH] Pull down to refresh in malls page --- src/app/cart/cart.page.ts | 7 +++++++ src/app/malls/malls.page.html | 9 +++++++++ src/app/malls/malls.page.ts | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/src/app/cart/cart.page.ts b/src/app/cart/cart.page.ts index ca27345..3ca3e25 100644 --- a/src/app/cart/cart.page.ts +++ b/src/app/cart/cart.page.ts @@ -62,6 +62,13 @@ export class CartPage implements OnInit { url: url } }); + + modal.onDidDismiss().then(() => { + this.showMenuButton(); + localStorage.removeItem('userCart'); + this.router.navigate(['/profile']); + }); + return await modal.present(); } diff --git a/src/app/malls/malls.page.html b/src/app/malls/malls.page.html index 97e4993..2357c7f 100644 --- a/src/app/malls/malls.page.html +++ b/src/app/malls/malls.page.html @@ -1,4 +1,13 @@ + + + + +
diff --git a/src/app/malls/malls.page.ts b/src/app/malls/malls.page.ts index 0df8b95..061dd41 100644 --- a/src/app/malls/malls.page.ts +++ b/src/app/malls/malls.page.ts @@ -25,7 +25,17 @@ export class MallsPage implements OnInit { ) { } ngOnInit() { + if (localStorage.allMalls) { + this.allMalls = JSON.parse(localStorage.allMalls); + this.tempMalls = JSON.parse(localStorage.allMalls); + } else { + this.getMallsByLocation() + } + } + + doRefresh(e: any) { this.getMallsByLocation(); + e.target.complete(); } toggleSearchBar() {