Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Potentially fix "Donate" screen crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Jun 11, 2022
1 parent 8ec0bbd commit a43fd19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

#Fix Crashig "Donate" scree
-keep class com.ivy.wallet.ui.donate.** { *; }

# Fix broken stuff by R8
-keep class com.ivy.wallet.ui.widget.** { *; }
-keep class com.ivy.wallet.domain.data.** { *; }
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/ivy/wallet/ui/donate/DonateState.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.ivy.wallet.ui.donate

sealed class DonateState {
object Loading : DonateState()

object Success : DonateState()

data class Error(
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/ivy/wallet/ui/donate/DonateViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import javax.inject.Inject
class DonateViewModel @Inject constructor(
private val ivyBilling: IvyBilling
) : FRPViewModel<DonateState, DonateEvent>() {
override val _state: MutableStateFlow<DonateState> = MutableStateFlow(DonateState.Loading)
override val _state: MutableStateFlow<DonateState> = MutableStateFlow(DonateState.Success)

val plans = mutableListOf<Plan>()

Expand All @@ -32,7 +32,6 @@ class DonateViewModel @Inject constructor(
viewModelScope.launch {
plans.clear()
plans.addAll(ivyBilling.fetchOneTimePlans())
updateStateNonBlocking { DonateState.Success }
}
},
onError = { code, msg ->
Expand All @@ -42,7 +41,7 @@ class DonateViewModel @Inject constructor(
},
onPurchases = {}
)
stateVal()
DonateState.Success
}

private fun donate(event: DonateEvent.Donate) = suspend {
Expand Down

0 comments on commit a43fd19

Please sign in to comment.