From d0d91bf124826779983817b968e455914da70bb5 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Thu, 16 Nov 2023 00:44:03 +0100 Subject: [PATCH] Fix --- .../util/PurchaseResultExtensions.kt | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/PurchaseResultExtensions.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/PurchaseResultExtensions.kt index 091a50d69df5..bf6dbec35e73 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/PurchaseResultExtensions.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/PurchaseResultExtensions.kt @@ -37,7 +37,7 @@ fun PurchaseResult.toPaymentDialogData(): PaymentDialogData? = PaymentDialogData( title = R.string.payment_pending_dialog_title, message = R.string.payment_pending_dialog_message, - confirmAction = PaymentDialogAction.Close() + confirmAction = PaymentDialogAction.Close ) // Success state PurchaseResult.Completed.Success -> @@ -45,7 +45,8 @@ fun PurchaseResult.toPaymentDialogData(): PaymentDialogData? = title = R.string.payment_completed_dialog_title, message = R.string.payment_completed_dialog_message, icon = PaymentDialogIcon.SUCCESS, - confirmAction = PaymentDialogAction.Close(successfulPayment = true) + confirmAction = PaymentDialogAction.Close, + successfulPayment = true ) // Error states is PurchaseResult.Error.TransactionIdError -> @@ -53,9 +54,8 @@ fun PurchaseResult.toPaymentDialogData(): PaymentDialogData? = title = R.string.payment_obfuscation_id_error_dialog_title, message = R.string.payment_obfuscation_id_error_dialog_message, icon = PaymentDialogIcon.FAIL, - confirmAction = PaymentDialogAction.Close(), - dismissAction = PaymentDialogAction.RetryPurchase, - productId = this.productId + confirmAction = PaymentDialogAction.Close, + dismissAction = PaymentDialogAction.RetryPurchase(productId = this.productId), ) is PurchaseResult.Error.FetchProductsError, is PurchaseResult.Error.NoProductFound -> { @@ -63,14 +63,16 @@ fun PurchaseResult.toPaymentDialogData(): PaymentDialogData? = title = R.string.payment_billing_error_dialog_title, message = R.string.payment_billing_error_dialog_message, icon = PaymentDialogIcon.FAIL, - confirmAction = PaymentDialogAction.Close(), - dismissAction = PaymentDialogAction.RetryPurchase, - productId = - when (this) { - is PurchaseResult.Error.FetchProductsError -> this.productId - is PurchaseResult.Error.NoProductFound -> this.productId - else -> ProductId("") - } + confirmAction = PaymentDialogAction.Close, + dismissAction = + PaymentDialogAction.RetryPurchase( + productId = + when (this) { + is PurchaseResult.Error.FetchProductsError -> this.productId + is PurchaseResult.Error.NoProductFound -> this.productId + else -> ProductId("") + } + ), ) } }