mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix: paymentUrls is null (#1786)
* fix: paymentUrls is null * feat: potential secure storage error
This commit is contained in:
parent
389c334f10
commit
8e12fb1ad9
3 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
class CakePayOrder {
|
class CakePayOrder {
|
||||||
final String orderId;
|
final String orderId;
|
||||||
final List<OrderCard> cards;
|
final List<OrderCard> cards;
|
||||||
|
|
|
@ -82,10 +82,12 @@ class CakePayService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logout
|
/// Logout
|
||||||
Future<void> logout(String email) async {
|
Future<void> logout([String? email]) async {
|
||||||
await secureStorage.delete(key: cakePayUsernameStorageKey);
|
await secureStorage.delete(key: cakePayUsernameStorageKey);
|
||||||
await secureStorage.delete(key: cakePayUserTokenKey);
|
await secureStorage.delete(key: cakePayUserTokenKey);
|
||||||
await cakePayApi.logoutUser(email: email, apiKey: cakePayApiKey);
|
if (email != null) {
|
||||||
|
await cakePayApi.logoutUser(email: email, apiKey: cakePayApiKey);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Purchase Gift Card
|
/// Purchase Gift Card
|
||||||
|
|
|
@ -258,7 +258,11 @@ class CakePayBuyCardDetailPage extends BasePage {
|
||||||
if (!isLogged) {
|
if (!isLogged) {
|
||||||
Navigator.of(context).pushNamed(Routes.cakePayWelcomePage);
|
Navigator.of(context).pushNamed(Routes.cakePayWelcomePage);
|
||||||
} else {
|
} else {
|
||||||
await cakePayPurchaseViewModel.createOrder();
|
try {
|
||||||
|
await cakePayPurchaseViewModel.createOrder();
|
||||||
|
} catch (_) {
|
||||||
|
await cakePayPurchaseViewModel.cakePayService.logout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue