Fix some logic

This commit is contained in:
Eric Bailey
2024-12-08 18:29:51 -06:00
parent be2606ea9d
commit 1269a55958
2 changed files with 33 additions and 42 deletions
@@ -85,7 +85,7 @@ function DialogInner({control}: {control: Dialog.DialogControlProps}) {
return return
} }
const emailValue = email ?? currentAccount.email const emailValue = email || currentAccount.email
if (!emailValue) { if (!emailValue) {
const message = _( const message = _(
@@ -109,6 +109,7 @@ function DialogInner({control}: {control: Dialog.DialogControlProps}) {
if (isWeb) { if (isWeb) {
try { try {
await purchase() await purchase()
// TODO handle errors the same for both platforms, throw and display
control.close() control.close()
} catch (e: any) { } catch (e: any) {
setError( setError(
+5 -15
View File
@@ -145,19 +145,13 @@ function Core({
<PurchaseHeader /> <PurchaseHeader />
)} )}
{hasActiveSubscriptions || {(hasActiveSubscriptions || hasInactiveSubscriptions) && (
(hasInactiveSubscriptions && ( // TODO need a divider here if PurchaseHeader is present
<> <>
<Divider />
{hasActiveSubscriptions && ( {hasActiveSubscriptions && (
<View style={[a.gap_sm]}> <View style={[a.gap_sm]}>
<Text <Text
style={[ style={[a.text_md, a.font_bold, t.atoms.text_contrast_medium]}>
a.text_md,
a.font_bold,
t.atoms.text_contrast_medium,
]}>
<Trans>My subscriptions</Trans> <Trans>My subscriptions</Trans>
</Text> </Text>
@@ -174,11 +168,7 @@ function Core({
{hasInactiveSubscriptions && ( {hasInactiveSubscriptions && (
<View style={[a.gap_sm]}> <View style={[a.gap_sm]}>
<Text <Text
style={[ style={[a.text_md, a.font_bold, t.atoms.text_contrast_medium]}>
a.text_md,
a.font_bold,
t.atoms.text_contrast_medium,
]}>
<Trans>Past subscriptions</Trans> <Trans>Past subscriptions</Trans>
</Text> </Text>
@@ -192,7 +182,7 @@ function Core({
</View> </View>
)} )}
</> </>
))} )}
<Divider /> <Divider />