Updated on 2026-08-14
This commit is contained in:
parent
b9ce4eeefc
commit
56bf204cc5
2 changed files with 22 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.tap.features.home.redux
|
||||
|
||||
import android.content.res.Resources
|
||||
import com.tangem.common.doOnFailure
|
||||
import com.tangem.common.doOnResult
|
||||
import com.tangem.common.doOnSuccess
|
||||
|
|
@ -26,13 +27,22 @@ import kotlinx.coroutines.launch
|
|||
import org.rekotlin.Action
|
||||
import org.rekotlin.Middleware
|
||||
import timber.log.Timber
|
||||
import java.util.Locale
|
||||
|
||||
internal const val HIDE_PROGRESS_DELAY = 400L
|
||||
|
||||
object HomeMiddleware {
|
||||
val handler = homeMiddleware
|
||||
|
||||
const val NEW_BUY_WALLET_URL = "https://buy.tangem.com/?utm_source=tangem&utm_medium=app"
|
||||
private val SYSTEM_LANGUAGE =
|
||||
runCatching { Resources.getSystem().configuration.locales[0].language }.getOrElse { "" }
|
||||
private val APP_LANGUAGE = Locale.getDefault().language
|
||||
private val UTM_MARKS = "utm_source=tangem-app" +
|
||||
"&utm_medium=app" +
|
||||
"&utm_campaign=prospect-$SYSTEM_LANGUAGE" +
|
||||
"&utm_content=devicelang-$APP_LANGUAGE"
|
||||
|
||||
val NEW_BUY_WALLET_URL = "https://buy.tangem.com/?$UTM_MARKS"
|
||||
}
|
||||
|
||||
private val homeMiddleware: Middleware<AppState> = { _, _ ->
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.features.details.model
|
||||
|
||||
import android.content.res.Resources
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.core.analytics.AppInstanceIdProvider
|
||||
import com.tangem.core.decompose.di.ModelScoped
|
||||
|
|
@ -35,13 +36,14 @@ import kotlinx.coroutines.flow.update
|
|||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import timber.log.Timber
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
|
||||
@ModelScoped
|
||||
@Suppress("LongParameterList")
|
||||
internal class DetailsModel @Inject constructor(
|
||||
socialsBuilder: SocialsBuilder,
|
||||
private val itemsBuilder: ItemsBuilder,
|
||||
itemsBuilder: ItemsBuilder,
|
||||
private val appVersionProvider: AppVersionProvider,
|
||||
private val checkIsWalletConnectAvailableUseCase: CheckIsWalletConnectAvailableUseCase,
|
||||
private val router: Router,
|
||||
|
|
@ -212,6 +214,13 @@ internal class DetailsModel @Inject constructor(
|
|||
}
|
||||
|
||||
private companion object {
|
||||
const val BUY_TANGEM_URL = "https://buy.tangem.com/?utm_source=tangem&utm_medium=app"
|
||||
val SYSTEM_LANGUAGE = runCatching { Resources.getSystem().configuration.locales[0].language }.getOrElse { "" }
|
||||
val APP_LANGUAGE = Locale.getDefault().language
|
||||
val UTM_MARKS = "utm_source=tangem-app" +
|
||||
"&utm_medium=app" +
|
||||
"&utm_campaign=users-$SYSTEM_LANGUAGE" +
|
||||
"&utm_content=devicelang-$APP_LANGUAGE"
|
||||
|
||||
val BUY_TANGEM_URL = "https://buy.tangem.com/?$UTM_MARKS"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue