Skip to content

Commit

Permalink
Merge pull request #546 from mysteriumnetwork/bugfix/retry_loading
Browse files Browse the repository at this point in the history
Fixed retry loading
  • Loading branch information
IrynaTsymbaliukGeniusee authored Mar 22, 2022
2 parents 22a5767 + cb805a8 commit b28c417
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract class BaseActivity : AppCompatActivity() {

override fun finish() {
super.finish()
overridePendingTransition(R.anim.slide_in_left,R.anim.slide_out_right)
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right)
}

open fun retryLoading() {
Expand Down Expand Up @@ -225,14 +225,14 @@ abstract class BaseActivity : AppCompatActivity() {
insufficientFundsPopUp()
}
baseViewModel.isInternetAvailable.observe(this) { isAvailable ->
isInternetAvailable = isAvailable
if (!isAvailable) {
wifiNetworkErrorPopUp()
} else {
} else if (!isInternetAvailable) {
wifiErrorDialog?.dismiss()
wifiErrorDialog = null
retryLoading()
}
isInternetAvailable = isAvailable
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class ConnectionActivity : BaseActivity() {
navigateBack()
}
viewModel.successConnectEvent.observe(this) {
proposal = it
analytic.trackEvent(
eventName = AnalyticEvent.CONNECT_SUCCESS.eventName,
proposal = proposal
Expand Down Expand Up @@ -279,10 +280,8 @@ class ConnectionActivity : BaseActivity() {
)
val countryCode = intent?.extras?.getString(COUNTRY_CODE_KEY)
val proposalExtra = intent.extras?.getParcelable<Proposal>(EXTRA_PROPOSAL_MODEL)
if ((connectionType == ConnectionType.MANUAL_CONNECT && proposal?.providerID != proposalExtra?.providerID) || (connectionType == ConnectionType.SMART_CONNECT && proposal?.providerID == null && proposalExtra?.providerID == null)) {
if (viewModel.connectionStatus.value?.state != ConnectionState.CONNECTED) {
initViewModel(connectionType, countryCode, proposalExtra)
}
if (viewModel.connectionStatus.value?.state != ConnectionState.CONNECTED) {
initViewModel(connectionType, countryCode, proposalExtra)
}
manualDisconnecting()
proposal = proposalExtra
Expand Down Expand Up @@ -310,7 +309,7 @@ class ConnectionActivity : BaseActivity() {
proposalExtra,
exchangeRateViewModel.usdEquivalent
)
} else {
} else if (connectionType == ConnectionType.SMART_CONNECT) {
viewModel.smartConnect(countryCode)
}
}
Expand Down Expand Up @@ -528,7 +527,7 @@ class ConnectionActivity : BaseActivity() {
}

private fun navigateBack() {
if (connectionType == ConnectionType.SMART_CONNECT) {
if (connectionType == ConnectionType.SMART_CONNECT) {
navigateToSelectNode(true)
} else {
backToFilter()
Expand Down

0 comments on commit b28c417

Please sign in to comment.