From 1269a55958fd772dfdacbd2b47a4ed370cdb25e8 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Sun, 8 Dec 2024 18:29:51 -0600 Subject: [PATCH] Fix some logic --- .../dialogs/BlueskyPlusCore/index.tsx | 3 +- src/screens/Subscriptions/index.tsx | 72 ++++++++----------- 2 files changed, 33 insertions(+), 42 deletions(-) diff --git a/src/components/dialogs/BlueskyPlusCore/index.tsx b/src/components/dialogs/BlueskyPlusCore/index.tsx index 5363f238f6..f1b4008ab9 100644 --- a/src/components/dialogs/BlueskyPlusCore/index.tsx +++ b/src/components/dialogs/BlueskyPlusCore/index.tsx @@ -85,7 +85,7 @@ function DialogInner({control}: {control: Dialog.DialogControlProps}) { return } - const emailValue = email ?? currentAccount.email + const emailValue = email || currentAccount.email if (!emailValue) { const message = _( @@ -109,6 +109,7 @@ function DialogInner({control}: {control: Dialog.DialogControlProps}) { if (isWeb) { try { await purchase() + // TODO handle errors the same for both platforms, throw and display control.close() } catch (e: any) { setError( diff --git a/src/screens/Subscriptions/index.tsx b/src/screens/Subscriptions/index.tsx index c66d6cc610..cbca9e8a92 100644 --- a/src/screens/Subscriptions/index.tsx +++ b/src/screens/Subscriptions/index.tsx @@ -145,54 +145,44 @@ function Core({ )} - {hasActiveSubscriptions || - (hasInactiveSubscriptions && ( - <> - + {(hasActiveSubscriptions || hasInactiveSubscriptions) && ( + // TODO need a divider here if PurchaseHeader is present + <> + {hasActiveSubscriptions && ( + + + My subscriptions + - {hasActiveSubscriptions && ( - - - My subscriptions - - - - - {activeSubscriptions.map(sub => ( - - ))} - + + + {activeSubscriptions.map(sub => ( + + ))} - )} + + )} - {hasInactiveSubscriptions && ( - - - Past subscriptions - + {hasInactiveSubscriptions && ( + + + Past subscriptions + - - - {inactiveSubscriptions.map(sub => ( - - ))} - + + + {inactiveSubscriptions.map(sub => ( + + ))} - )} - - ))} + + )} + + )}