mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Remove deprecated LevelConfiguration#name.
Co-authored-by: Alex Hart <alex@signal.org>
This commit is contained in:
committed by
Greyson Parrelli
parent
200132e623
commit
ba34a74e2d
@@ -115,7 +115,7 @@ class GiftFlowConfirmationFragment :
|
||||
|
||||
val continueButton = requireView().findViewById<MaterialButton>(R.id.continue_button)
|
||||
continueButton.setOnClickListener {
|
||||
lifecycleDisposable += viewModel.insertInAppPayment(requireContext()).subscribe { inAppPayment ->
|
||||
lifecycleDisposable += viewModel.insertInAppPayment().subscribe { inAppPayment ->
|
||||
findNavController().safeNavigate(
|
||||
GiftFlowConfirmationFragmentDirections.actionGiftFlowConfirmationFragmentToGatewaySelectorBottomSheet(
|
||||
inAppPayment
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package org.thoughtcrime.securesms.badges.gifts.flow
|
||||
|
||||
import android.content.Context
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import org.signal.core.util.money.FiatMoney
|
||||
import org.signal.donations.InAppPaymentType
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.badges.Badges
|
||||
import org.thoughtcrime.securesms.badges.models.Badge
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.DonationSerializationHelper.toFiatValue
|
||||
@@ -25,7 +23,7 @@ import java.util.Locale
|
||||
*/
|
||||
class GiftFlowRepository {
|
||||
|
||||
fun insertInAppPayment(context: Context, giftSnapshot: GiftFlowState): Single<InAppPaymentTable.InAppPayment> {
|
||||
fun insertInAppPayment(giftSnapshot: GiftFlowState): Single<InAppPaymentTable.InAppPayment> {
|
||||
return Single.fromCallable {
|
||||
SignalDatabase.inAppPayments.insert(
|
||||
type = InAppPaymentType.ONE_TIME_GIFT,
|
||||
@@ -34,7 +32,6 @@ class GiftFlowRepository {
|
||||
endOfPeriod = null,
|
||||
inAppPaymentData = InAppPaymentData(
|
||||
badge = Badges.toDatabaseBadge(giftSnapshot.giftBadge!!),
|
||||
label = context.getString(R.string.preferences__one_time),
|
||||
amount = giftSnapshot.giftPrices[giftSnapshot.currency]!!.toFiatValue(),
|
||||
level = giftSnapshot.giftLevel!!,
|
||||
recipientId = giftSnapshot.recipient!!.id.serialize(),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.thoughtcrime.securesms.badges.gifts.flow
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
@@ -104,9 +103,9 @@ class GiftFlowViewModel(
|
||||
)
|
||||
}
|
||||
|
||||
fun insertInAppPayment(context: Context): Single<InAppPaymentTable.InAppPayment> {
|
||||
fun insertInAppPayment(): Single<InAppPaymentTable.InAppPayment> {
|
||||
val giftSnapshot = snapshot
|
||||
return giftFlowRepository.insertInAppPayment(context, giftSnapshot)
|
||||
return giftFlowRepository.insertInAppPayment(giftSnapshot)
|
||||
.doOnSuccess { inAppPayment ->
|
||||
store.update { it.copy(inAppPaymentId = inAppPayment.id) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user