Updated on 2026-08-14
This commit is contained in:
parent
e98780ff93
commit
479d142807
283 changed files with 2338 additions and 2730 deletions
|
|
@ -51,6 +51,7 @@ class Start2CoinDisclaimer(dataProvider: DisclaimerDataProvider) : BaseDisclaime
|
|||
override fun getUri(): Uri = Uri.parse("$baseUrl/" + filename(dataProvider.getLanguage(), getRegion()))
|
||||
override fun getPreferenceKey(): String = "start2Coin_tos_accepted_${getRegion()}"
|
||||
|
||||
@Suppress("ComplexMethod")
|
||||
private fun filename(languageCode: String, regionCode: String?): String {
|
||||
return when {
|
||||
languageCode == "fr" && regionCode == "ch" -> "start2coin-fr-ch-tangem.html"
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ package com.tangem.tap.features.disclaimer.redux
|
|||
import com.tangem.tap.common.redux.AppState
|
||||
import org.rekotlin.Action
|
||||
|
||||
class DisclaimerReducer {
|
||||
companion object {
|
||||
fun reduce(action: Action, state: AppState): DisclaimerState = internalReduce(action, state)
|
||||
}
|
||||
object DisclaimerReducer {
|
||||
fun reduce(action: Action, state: AppState): DisclaimerState = internalReduce(action, state)
|
||||
}
|
||||
|
||||
private fun internalReduce(action: Action, state: AppState): DisclaimerState {
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ data class DisclaimerState(
|
|||
val showedFromScreen: AppScreen = AppScreen.Home,
|
||||
val callback: DisclaimerCallback? = null,
|
||||
val progressState: ProgressState? = null,
|
||||
) : StateType {
|
||||
}
|
||||
) : StateType
|
||||
|
||||
data class DisclaimerCallback(
|
||||
val onAccept: VoidCallback? = null,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import android.view.View
|
|||
import androidx.transition.TransitionInflater
|
||||
import by.kirich1409.viewbindingdelegate.viewBinding
|
||||
import com.tangem.core.ui.fragments.setStatusBarColor
|
||||
import com.tangem.tap.common.extensions.configureSettings
|
||||
import com.tangem.tap.common.extensions.beginDelayedTransition
|
||||
import com.tangem.tap.common.extensions.hide
|
||||
import com.tangem.tap.common.extensions.show
|
||||
|
|
|
|||
|
|
@ -59,10 +59,14 @@ class DisclaimerWebViewClient : WebViewClient() {
|
|||
super.onReceivedHttpError(view, resourceRequest, errorResponse)
|
||||
|
||||
ifNotNull(resourceRequest, errorResponse) { request, response ->
|
||||
if (request.url?.toString() != loadingUrl || response.statusCode < 400) return
|
||||
if (request.url?.toString() != loadingUrl || response.statusCode < RESPONSE_USER_ERROR_STATUS_CODE) return
|
||||
if (progressState != ProgressState.Done) return
|
||||
|
||||
progressState = ProgressState.Error
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val RESPONSE_USER_ERROR_STATUS_CODE = 400
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue