Updated on 2026-08-14

This commit is contained in:
Tangem 2026-03-25 17:27:32 +05:00
parent 2f7bcb9cbb
commit d050fa2654
18 changed files with 12 additions and 568 deletions

View file

@ -154,24 +154,6 @@ class MainScreenPageObject(semanticsProvider: SemanticsNodeInteractionsProvider)
useUnmergedTree = true useUnmergedTree = true
} }
val seedPhraseNotificationIcon: KNode = child {
hasAnySibling(withText(getResourceString(R.string.warning_seedphrase_issue_title)))
hasTestTag(NotificationTestTags.ICON)
useUnmergedTree = true
}
val seedPhraseNotificationTitle: KNode = child {
hasTestTag(NotificationTestTags.TITLE)
hasText(getResourceString(R.string.warning_seedphrase_issue_title))
useUnmergedTree = true
}
val seedPhraseNotificationMessage: KNode = child {
hasTestTag(NotificationTestTags.MESSAGE)
hasText(getResourceString(R.string.warning_seedphrase_issue_message))
useUnmergedTree = true
}
val totalBalanceContainer: KNode = child { val totalBalanceContainer: KNode = child {
hasTestTag(MainScreenTestTags.WALLET_LIST_ITEM) hasTestTag(MainScreenTestTags.WALLET_LIST_ITEM)
} }

View file

@ -55,43 +55,4 @@ class WarningTest : BaseTestCase() {
} }
} }
} }
@AllureId("227")
@DisplayName("Seed notify: check warning for wallet with seed phrase")
@Test
fun checkWarningForWalletWithSeedPhraseTest() {
val scenarioName = "seedphrase_notification"
val scenarioState = "Notified"
setupHooks(
additionalBeforeSection = {
step("Setup WireMock scenario '$scenarioName' for '$scenarioState' state") {
setWireMockScenarioState(scenarioName, scenarioState)
}
},
additionalAfterSection = {
step("Reset WireMock scenario '$scenarioName' state") {
resetWireMockScenarioState(scenarioName)
}
}
).run {
step("Open 'Main' screen") {
openMainScreen(mockContent = Wallet2WithSeedPhraseMockContent)
}
step("Assert 'Seed phrase' notification icon is displayed") {
onMainScreen { seedPhraseNotificationIcon.assertIsDisplayed() }
}
step("Assert 'Seed phrase' notification title is displayed") {
onMainScreen { seedPhraseNotificationTitle.assertIsDisplayed() }
}
step("Assert 'Seed phrase' notification message is displayed") {
onMainScreen { seedPhraseNotificationMessage.assertIsDisplayed() }
}
step("Assert notification 'Yes' button is displayed") {
onMainScreen { notificationYesButton.assertIsDisplayed() }
}
step("Assert notification 'No' button is displayed") {
onMainScreen { notificationNoButton.assertIsDisplayed() }
}
}
}
} }

View file

@ -222,12 +222,6 @@ internal object WalletsDomainModule {
) )
} }
@Provides
@Singleton
fun providesSeedPhraseNotificationUseCase(walletsRepository: WalletsRepository): SeedPhraseNotificationUseCase {
return SeedPhraseNotificationUseCase(walletsRepository = walletsRepository)
}
@Provides @Provides
@Singleton @Singleton
fun provideGetCardImageUseCase(cardArtworksProvider: CardArtworksProvider): GetCardImageUseCase { fun provideGetCardImageUseCase(cardArtworksProvider: CardArtworksProvider): GetCardImageUseCase {

View file

@ -12,11 +12,8 @@ import com.tangem.datasource.api.common.response.getOrThrow
import com.tangem.datasource.api.common.response.isNetworkError import com.tangem.datasource.api.common.response.isNetworkError
import com.tangem.datasource.api.tangemTech.TangemTechApi import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.api.tangemTech.models.* import com.tangem.datasource.api.tangemTech.models.*
import com.tangem.datasource.api.tangemTech.models.SeedPhraseNotificationDTO.Status
import com.tangem.datasource.local.datastore.RuntimeStateStore
import com.tangem.datasource.local.preferences.AppPreferencesStore import com.tangem.datasource.local.preferences.AppPreferencesStore
import com.tangem.datasource.local.preferences.PreferencesKeys import com.tangem.datasource.local.preferences.PreferencesKeys
import com.tangem.datasource.local.preferences.PreferencesKeys.SEED_FIRST_NOTIFICATION_SHOW_TIME
import com.tangem.datasource.local.preferences.utils.getObjectMap import com.tangem.datasource.local.preferences.utils.getObjectMap
import com.tangem.datasource.local.preferences.utils.getSyncOrDefault import com.tangem.datasource.local.preferences.utils.getSyncOrDefault
import com.tangem.datasource.local.preferences.utils.getSyncOrNull import com.tangem.datasource.local.preferences.utils.getSyncOrNull
@ -26,27 +23,20 @@ import com.tangem.domain.common.wallets.getSyncOrNull
import com.tangem.domain.common.wallets.getSyncStrict import com.tangem.domain.common.wallets.getSyncStrict
import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.UserWalletId import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.models.UserWalletRemoteInfo import com.tangem.domain.wallets.models.UserWalletRemoteInfo
import com.tangem.domain.wallets.models.errors.ActivatePromoCodeError import com.tangem.domain.wallets.models.errors.ActivatePromoCodeError
import com.tangem.domain.wallets.repository.WalletsRepository import com.tangem.domain.wallets.repository.WalletsRepository
import com.tangem.utils.WEEK_MILLIS
import com.tangem.utils.coroutines.CoroutineDispatcherProvider import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.coroutines.runCatching
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.flow.* import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
typealias SeedPhraseNotificationsStatuses = Map<UserWalletId, SeedPhraseNotificationsStatus>
@Suppress("TooManyFunctions", "LargeClass", "LongParameterList") @Suppress("TooManyFunctions", "LargeClass", "LongParameterList")
internal class DefaultWalletsRepository( internal class DefaultWalletsRepository(
private val appPreferencesStore: AppPreferencesStore, private val appPreferencesStore: AppPreferencesStore,
private val tangemTechApi: TangemTechApi, private val tangemTechApi: TangemTechApi,
private val userWalletsListRepository: UserWalletsListRepository, private val userWalletsListRepository: UserWalletsListRepository,
private val seedPhraseNotificationVisibilityStore: RuntimeStateStore<SeedPhraseNotificationsStatuses>,
private val dispatchers: CoroutineDispatcherProvider, private val dispatchers: CoroutineDispatcherProvider,
private val walletServerBinder: WalletServerBinder, private val walletServerBinder: WalletServerBinder,
private val moshi: com.squareup.moshi.Moshi, private val moshi: com.squareup.moshi.Moshi,
@ -128,148 +118,10 @@ internal class DefaultWalletsRepository(
} }
} }
override fun seedPhraseNotificationStatus(userWalletId: UserWalletId): Flow<SeedPhraseNotificationsStatus> {
return channelFlow {
launch {
seedPhraseNotificationVisibilityStore.get()
.map { map ->
map.getOrDefault(
key = userWalletId,
defaultValue = SeedPhraseNotificationsStatus.NOT_NEEDED,
)
}
.collectLatest(::send)
}
fetchSeedPhraseNotificationStatus(userWalletId)
}
}
private suspend fun fetchSeedPhraseNotificationStatus(userWalletId: UserWalletId) {
val userWallet = userWalletsListRepository.getSyncOrNull(id = userWalletId)
if (userWallet != null && userWallet !is UserWallet.Cold) {
updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
return
}
val status = if (userWallet?.isImported == false) {
Status.NOT_NEEDED
} else {
runCatching(dispatchers.io) {
tangemTechApi.getSeedPhraseNotificationStatus(walletId = userWalletId.stringValue).getOrThrow()
}.fold(
onSuccess = { it.status },
onFailure = { throwable ->
if (throwable is HttpException && throwable.code == HttpException.Code.NOT_FOUND) {
Status.NOTIFIED
} else {
Status.NOT_NEEDED
}
},
)
}
when {
status == Status.NOTIFIED -> updateNotificationVisibility(
id = userWalletId,
value = SeedPhraseNotificationsStatus.SHOW_FIRST,
)
status == Status.CONFIRMED && checkNeedFetchSecondNotification() ->
fetchSeedPhraseSecondNotificationStatus(userWalletId)
else -> updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
}
}
private suspend fun fetchSeedPhraseSecondNotificationStatus(userWalletId: UserWalletId) {
val status = runCatching(dispatchers.io) {
tangemTechApi.getSeedPhraseSecondNotificationStatus(walletId = userWalletId.stringValue).getOrThrow()
}.fold(
onSuccess = { it.status },
onFailure = { Status.NOT_NEEDED },
)
val showStatus = when (status) {
Status.CONFIRMED -> SeedPhraseNotificationsStatus.SHOW_SECOND
else -> SeedPhraseNotificationsStatus.NOT_NEEDED
}
updateNotificationVisibility(id = userWalletId, value = showStatus)
}
private suspend fun checkNeedFetchSecondNotification(): Boolean {
val firstNotificationTime =
appPreferencesStore.getSyncOrDefault(SEED_FIRST_NOTIFICATION_SHOW_TIME, default = 0L)
return System.currentTimeMillis() - firstNotificationTime > WEEK_MILLIS
}
override suspend fun notifiedSeedPhraseNotification(userWalletId: UserWalletId) {
runCatching(dispatchers.io) {
tangemTechApi.updateSeedPhraseNotificationStatus(
walletId = userWalletId.stringValue,
body = SeedPhraseNotificationDTO(status = Status.NOTIFIED),
).getOrThrow()
}
}
override suspend fun confirmSeedPhraseNotification(userWalletId: UserWalletId) {
runCatching(dispatchers.io) {
tangemTechApi.updateSeedPhraseNotificationStatus(
walletId = userWalletId.stringValue,
body = SeedPhraseNotificationDTO(status = Status.CONFIRMED),
).getOrThrow()
appPreferencesStore.store(key = SEED_FIRST_NOTIFICATION_SHOW_TIME, value = System.currentTimeMillis())
}
updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
}
override suspend fun declineSeedPhraseNotification(userWalletId: UserWalletId) {
runCatching(dispatchers.io) {
tangemTechApi.updateSeedPhraseNotificationStatus(
walletId = userWalletId.stringValue,
body = SeedPhraseNotificationDTO(status = Status.DECLINED),
).getOrThrow()
appPreferencesStore.store(key = SEED_FIRST_NOTIFICATION_SHOW_TIME, value = System.currentTimeMillis())
}
updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
}
override suspend fun createWallet(userWalletId: UserWalletId) { override suspend fun createWallet(userWalletId: UserWalletId) {
walletServerBinder.bind(userWalletId) walletServerBinder.bind(userWalletId)
} }
override suspend fun rejectSeedPhraseSecondNotification(userWalletId: UserWalletId) {
runCatching(dispatchers.io) {
tangemTechApi.updateSeedPhraseSecondNotificationStatus(
walletId = userWalletId.stringValue,
body = SeedPhraseNotificationDTO(status = Status.REJECTED),
).getOrThrow()
}
updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
}
override suspend fun acceptSeedPhraseSecondNotification(userWalletId: UserWalletId) {
runCatching(dispatchers.io) {
tangemTechApi.updateSeedPhraseSecondNotificationStatus(
walletId = userWalletId.stringValue,
body = SeedPhraseNotificationDTO(status = Status.ACCEPTED),
).getOrThrow()
}
updateNotificationVisibility(id = userWalletId, value = SeedPhraseNotificationsStatus.NOT_NEEDED)
}
private suspend fun updateNotificationVisibility(id: UserWalletId, value: SeedPhraseNotificationsStatus) {
return seedPhraseNotificationVisibilityStore.update { map ->
map.toMutableMap().apply {
this[id] = value
}
}
}
override fun nftEnabledStatus(userWalletId: UserWalletId): Flow<Boolean> = appPreferencesStore override fun nftEnabledStatus(userWalletId: UserWalletId): Flow<Boolean> = appPreferencesStore
.getObjectMap<Boolean>(PreferencesKeys.WALLETS_NFT_ENABLED_STATES_KEY) .getObjectMap<Boolean>(PreferencesKeys.WALLETS_NFT_ENABLED_STATES_KEY)
.map { it[userWalletId.stringValue] == true } .map { it[userWalletId.stringValue] == true }

View file

@ -12,7 +12,6 @@ import com.tangem.data.wallets.hot.DefaultHotWalletAccessCodeAttemptsRepository
import com.tangem.datasource.api.tangemTech.TangemTechApi import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.di.NetworkMoshi import com.tangem.datasource.di.NetworkMoshi
import com.tangem.datasource.local.appsflyer.AppsFlyerStore import com.tangem.datasource.local.appsflyer.AppsFlyerStore
import com.tangem.datasource.local.datastore.RuntimeStateStore
import com.tangem.datasource.local.preferences.AppPreferencesStore import com.tangem.datasource.local.preferences.AppPreferencesStore
import com.tangem.domain.common.wallets.UserWalletsListRepository import com.tangem.domain.common.wallets.UserWalletsListRepository
import com.tangem.domain.wallets.derivations.ColdMapDerivationsRepository import com.tangem.domain.wallets.derivations.ColdMapDerivationsRepository
@ -48,7 +47,6 @@ internal object WalletsDataModule {
appPreferencesStore = appPreferencesStore, appPreferencesStore = appPreferencesStore,
tangemTechApi = tangemTechApi, tangemTechApi = tangemTechApi,
userWalletsListRepository = userWalletsListRepository, userWalletsListRepository = userWalletsListRepository,
seedPhraseNotificationVisibilityStore = RuntimeStateStore(defaultValue = emptyMap()),
dispatchers = dispatchers, dispatchers = dispatchers,
walletServerBinder = walletServerBinder, walletServerBinder = walletServerBinder,
moshi = moshi, moshi = moshi,

View file

@ -45,7 +45,6 @@ class DefaultWalletsRepositoryTest {
appPreferencesStore = appPreferenceStore, appPreferencesStore = appPreferenceStore,
tangemTechApi = tangemTechApi, tangemTechApi = tangemTechApi,
userWalletsListRepository = mockk(), userWalletsListRepository = mockk(),
seedPhraseNotificationVisibilityStore = mockk(),
dispatchers = TestingCoroutineDispatcherProvider(), dispatchers = TestingCoroutineDispatcherProvider(),
walletServerBinder = walletServerBinder, walletServerBinder = walletServerBinder,
moshi = mockk(), moshi = mockk(),

View file

@ -1,8 +0,0 @@
package com.tangem.domain.wallets.models
enum class SeedPhraseNotificationsStatus {
SHOW_FIRST,
SHOW_SECOND,
NOT_NEEDED,
}

View file

@ -3,7 +3,6 @@ package com.tangem.domain.wallets.repository
import arrow.core.Either import arrow.core.Either
import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.UserWalletId import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.models.UserWalletRemoteInfo import com.tangem.domain.wallets.models.UserWalletRemoteInfo
import com.tangem.domain.wallets.models.errors.ActivatePromoCodeError import com.tangem.domain.wallets.models.errors.ActivatePromoCodeError
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
@ -23,18 +22,6 @@ interface WalletsRepository {
suspend fun setHasWalletsWithRing(userWalletId: UserWalletId) suspend fun setHasWalletsWithRing(userWalletId: UserWalletId)
fun seedPhraseNotificationStatus(userWalletId: UserWalletId): Flow<SeedPhraseNotificationsStatus>
suspend fun notifiedSeedPhraseNotification(userWalletId: UserWalletId)
suspend fun confirmSeedPhraseNotification(userWalletId: UserWalletId)
suspend fun declineSeedPhraseNotification(userWalletId: UserWalletId)
suspend fun rejectSeedPhraseSecondNotification(userWalletId: UserWalletId)
suspend fun acceptSeedPhraseSecondNotification(userWalletId: UserWalletId)
suspend fun createWallet(userWalletId: UserWalletId) suspend fun createWallet(userWalletId: UserWalletId)
fun nftEnabledStatus(userWalletId: UserWalletId): Flow<Boolean> fun nftEnabledStatus(userWalletId: UserWalletId): Flow<Boolean>

View file

@ -1,35 +0,0 @@
package com.tangem.domain.wallets.usecase
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.repository.WalletsRepository
import kotlinx.coroutines.flow.Flow
class SeedPhraseNotificationUseCase(
private val walletsRepository: WalletsRepository,
) {
operator fun invoke(userWalletId: UserWalletId): Flow<SeedPhraseNotificationsStatus> {
return walletsRepository.seedPhraseNotificationStatus(userWalletId)
}
suspend fun notified(userWalletId: UserWalletId) {
walletsRepository.notifiedSeedPhraseNotification(userWalletId)
}
suspend fun confirm(userWalletId: UserWalletId) {
walletsRepository.confirmSeedPhraseNotification(userWalletId)
}
suspend fun decline(userWalletId: UserWalletId) {
walletsRepository.declineSeedPhraseNotification(userWalletId)
}
suspend fun acceptSecond(userWalletId: UserWalletId) {
walletsRepository.acceptSeedPhraseSecondNotification(userWalletId)
}
suspend fun rejectSecond(userWalletId: UserWalletId) {
walletsRepository.rejectSeedPhraseSecondNotification(userWalletId)
}
}

View file

@ -2,7 +2,6 @@ package com.tangem.feature.wallet.child.wallet.model.intents
import arrow.core.getOrElse import arrow.core.getOrElse
import com.tangem.utils.logging.TangemLogger import com.tangem.utils.logging.TangemLogger
import com.tangem.common.TangemBlogUrlBuilder
import com.tangem.common.routing.AppRoute.* import com.tangem.common.routing.AppRoute.*
import com.tangem.common.routing.AppRouter import com.tangem.common.routing.AppRouter
import com.tangem.common.ui.notifications.NotificationId import com.tangem.common.ui.notifications.NotificationId
@ -45,7 +44,6 @@ import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnaly
import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.Basic import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.Basic
import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.MainScreen import com.tangem.feature.wallet.presentation.wallet.analytics.WalletScreenAnalyticsEvent.MainScreen
import com.tangem.feature.wallet.presentation.wallet.state.WalletStateController import com.tangem.feature.wallet.presentation.wallet.state.WalletStateController
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletAlertUM
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletEvent import com.tangem.feature.wallet.presentation.wallet.state.model.WalletEvent
import com.tangem.feature.wallet.presentation.wallet.state.utils.WalletEventSender import com.tangem.feature.wallet.presentation.wallet.state.utils.WalletEventSender
import com.tangem.features.pushnotifications.api.analytics.PushNotificationAnalyticEvents import com.tangem.features.pushnotifications.api.analytics.PushNotificationAnalyticEvents
@ -85,14 +83,6 @@ internal interface WalletWarningsClickIntents {
fun onNoteMigrationButtonClick(url: String) fun onNoteMigrationButtonClick(url: String)
fun onSeedPhraseNotificationConfirm()
fun onSeedPhraseNotificationDecline()
fun onSeedPhraseSecondNotificationAccept()
fun onSeedPhraseSecondNotificationReject()
fun onAllowPermissions() fun onAllowPermissions()
fun onDenyPermissions() fun onDenyPermissions()
@ -122,7 +112,6 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
private val shouldShowPromoWalletUseCase: ShouldShowPromoWalletUseCase, private val shouldShowPromoWalletUseCase: ShouldShowPromoWalletUseCase,
private val getWalletMetaInfoUseCase: GetWalletMetaInfoUseCase, private val getWalletMetaInfoUseCase: GetWalletMetaInfoUseCase,
private val sendFeedbackEmailUseCase: SendFeedbackEmailUseCase, private val sendFeedbackEmailUseCase: SendFeedbackEmailUseCase,
private val seedPhraseNotificationUseCase: SeedPhraseNotificationUseCase,
private val urlOpener: UrlOpener, private val urlOpener: UrlOpener,
private val multiNetworkStatusFetcher: MultiNetworkStatusFetcher, private val multiNetworkStatusFetcher: MultiNetworkStatusFetcher,
private val multiQuoteStatusFetcher: MultiQuoteStatusFetcher, private val multiQuoteStatusFetcher: MultiQuoteStatusFetcher,
@ -360,66 +349,6 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
} }
} }
override fun onSeedPhraseNotificationConfirm() {
val userWallet = getSelectedUserWallet() ?: return
analyticsEventHandler.send(MainScreen.NoticeSeedPhraseSupportButtonYes())
uiMessageSender.send(
WalletAlertUM.seedPhraseConfirm {
modelScope.launch {
seedPhraseNotificationUseCase.confirm(userWalletId = userWallet.walletId)
urlOpener.openUrl(
url = TangemBlogUrlBuilder.build(post = TangemBlogUrlBuilder.Post.SeedNotify),
)
}
},
)
}
override fun onSeedPhraseNotificationDecline() {
val userWallet = getSelectedUserWallet() ?: return
analyticsEventHandler.send(MainScreen.NoticeSeedPhraseSupportButtonNo())
uiMessageSender.send(
WalletAlertUM.seedPhraseDismiss {
modelScope.launch {
seedPhraseNotificationUseCase.decline(userWalletId = userWallet.walletId)
}
},
)
}
override fun onSeedPhraseSecondNotificationAccept() {
val userWallet = getSelectedUserWallet() ?: return
analyticsEventHandler.send(MainScreen.NoticeSeedPhraseSupportButtonUsed())
uiMessageSender.send(
WalletAlertUM.seedPhraseConfirm {
modelScope.launch {
seedPhraseNotificationUseCase.acceptSecond(userWalletId = userWallet.walletId)
urlOpener.openUrl(
url = TangemBlogUrlBuilder.build(post = TangemBlogUrlBuilder.Post.SeedNotifySecond),
)
}
},
)
}
override fun onSeedPhraseSecondNotificationReject() {
val userWallet = getSelectedUserWallet() ?: return
analyticsEventHandler.send(MainScreen.NoticeSeedPhraseSupportButtonDeclined())
modelScope.launch {
seedPhraseNotificationUseCase.rejectSecond(userWalletId = userWallet.walletId)
}
}
override fun onFinishWalletActivationClick(isBackupExists: Boolean) { override fun onFinishWalletActivationClick(isBackupExists: Boolean) {
analyticsEventHandler.send(MainScreen.ButtonFinalizeActivation()) analyticsEventHandler.send(MainScreen.ButtonFinalizeActivation())
val userWalletId = stateHolder.getSelectedWalletId() val userWalletId = stateHolder.getSelectedWalletId()

View file

@ -155,18 +155,6 @@ sealed class WalletScreenAnalyticsEvent {
class DeleteWalletTapped : MainScreen(event = "Button - Delete Wallet Tapped") class DeleteWalletTapped : MainScreen(event = "Button - Delete Wallet Tapped")
class NoticeSeedPhraseSupport : MainScreen(event = "Notice - Seed Phrase Support")
class NoticeSeedPhraseSupportSecond : MainScreen(event = "Notice - Seed Phrase Support2")
class NoticeSeedPhraseSupportButtonNo : MainScreen(event = "Button - Support No")
class NoticeSeedPhraseSupportButtonYes : MainScreen(event = "Button - Support Yes")
class NoticeSeedPhraseSupportButtonUsed : MainScreen(event = "Button - Support Used")
class NoticeSeedPhraseSupportButtonDeclined : MainScreen(event = "Button - Support Declined")
class NoticeUnrecognizedQr : MainScreen( class NoticeUnrecognizedQr : MainScreen(
event = "Notice - Unrecognized QR", event = "Notice - Unrecognized QR",
) )

View file

@ -116,8 +116,6 @@ internal class WalletWarningsAnalyticsSender @Inject constructor(
balanceState = balanceState, balanceState = balanceState,
) )
} }
is WalletNotification.Critical.SeedPhraseNotification -> NoticeSeedPhraseSupport()
is WalletNotification.Critical.SeedPhraseSecondNotification -> NoticeSeedPhraseSupportSecond()
is WalletNotification.PushNotifications -> PushBanner() is WalletNotification.PushNotifications -> PushBanner()
is WalletNotification.Warning.TangemPayRefreshNeeded -> null is WalletNotification.Warning.TangemPayRefreshNeeded -> null
is WalletNotification.Warning.TangemPayUnreachable -> null is WalletNotification.Warning.TangemPayUnreachable -> null
@ -163,8 +161,6 @@ internal class WalletWarningsAnalyticsSender @Inject constructor(
balanceState = balanceState, balanceState = balanceState,
) )
} }
is WalletNotificationUM.SeedPhraseNotification -> NoticeSeedPhraseSupport()
is WalletNotificationUM.SeedPhraseSecondNotification -> NoticeSeedPhraseSupportSecond()
is WalletNotificationUM.PushNotifications -> PushBanner() is WalletNotificationUM.PushNotifications -> PushBanner()
is WalletNotificationUM.UnlockWallets, is WalletNotificationUM.UnlockWallets,
is WalletNotificationUM.NoAccount, is WalletNotificationUM.NoAccount,

View file

@ -11,7 +11,6 @@ import com.tangem.core.ui.message.bottomSheetMessage
import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.UserWalletId import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.usecase.GetUserWalletUseCase import com.tangem.domain.wallets.usecase.GetUserWalletUseCase
import com.tangem.domain.wallets.usecase.SeedPhraseNotificationUseCase
import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType
import com.tangem.feature.wallet.impl.R import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification
@ -24,7 +23,6 @@ import javax.inject.Inject
@ModelScoped @ModelScoped
internal class WalletWarningsSingleEventSender @Inject constructor( internal class WalletWarningsSingleEventSender @Inject constructor(
private val seedPhraseNotificationUseCase: SeedPhraseNotificationUseCase,
private val screenLifecycleProvider: ScreenLifecycleProvider, private val screenLifecycleProvider: ScreenLifecycleProvider,
private val uiMessageSender: UiMessageSender, private val uiMessageSender: UiMessageSender,
private val getUserWalletUseCase: GetUserWalletUseCase, private val getUserWalletUseCase: GetUserWalletUseCase,
@ -32,11 +30,7 @@ internal class WalletWarningsSingleEventSender @Inject constructor(
) { ) {
private val isActivationBottomSheetShown: ConcurrentHashMap<UserWalletId, Boolean> = ConcurrentHashMap() private val isActivationBottomSheetShown: ConcurrentHashMap<UserWalletId, Boolean> = ConcurrentHashMap()
suspend fun send( fun send(userWalletId: UserWalletId, displayedUiState: WalletState?, newWarnings: List<WalletNotification>) {
userWalletId: UserWalletId,
displayedUiState: WalletState?,
newWarnings: List<WalletNotification>,
) {
if (screenLifecycleProvider.isBackgroundState.value) return if (screenLifecycleProvider.isBackgroundState.value) return
if (newWarnings.isEmpty()) return if (newWarnings.isEmpty()) return
if (displayedUiState == null || displayedUiState.pullToRefreshConfig.isRefreshing) return if (displayedUiState == null || displayedUiState.pullToRefreshConfig.isRefreshing) return
@ -51,9 +45,6 @@ internal class WalletWarningsSingleEventSender @Inject constructor(
events.forEach { event -> events.forEach { event ->
when (event) { when (event) {
is WalletNotification.Critical.SeedPhraseNotification -> {
seedPhraseNotificationUseCase.notified(userWalletId = userWalletId)
}
is WalletNotification.FinishWalletActivation -> { is WalletNotification.FinishWalletActivation -> {
// We check that map contains the first seen wallet (will return null instead false/true otherwise) // We check that map contains the first seen wallet (will return null instead false/true otherwise)
// and for this wallet we haven't shown the activation bs yet (check that returns false, not true) // and for this wallet we haven't shown the activation bs yet (check that returns false, not true)
@ -69,11 +60,7 @@ internal class WalletWarningsSingleEventSender @Inject constructor(
} }
} }
suspend fun send( fun send(userWalletId: UserWalletId, displayedWalletUM: WalletUM?, newNotifications: List<WalletNotificationUM>) {
userWalletId: UserWalletId,
displayedWalletUM: WalletUM?,
newNotifications: List<WalletNotificationUM>,
) {
if (screenLifecycleProvider.isBackgroundState.value) return if (screenLifecycleProvider.isBackgroundState.value) return
if (newNotifications.isEmpty()) return if (newNotifications.isEmpty()) return
if (displayedWalletUM == null || displayedWalletUM.pullToRefreshConfig.isRefreshing) return if (displayedWalletUM == null || displayedWalletUM.pullToRefreshConfig.isRefreshing) return
@ -89,9 +76,6 @@ internal class WalletWarningsSingleEventSender @Inject constructor(
events.forEach { event -> events.forEach { event ->
when (event) { when (event) {
is WalletNotificationUM.SeedPhraseNotification -> {
seedPhraseNotificationUseCase.notified(userWalletId = userWalletId)
}
is WalletNotificationUM.FinishWalletActivation -> { is WalletNotificationUM.FinishWalletActivation -> {
// We check that map contains the first seen wallet (will return null instead false/true otherwise) // We check that map contains the first seen wallet (will return null instead false/true otherwise)
// and for this wallet we haven't shown the activation bs yet (check that returns false, not true) // and for this wallet we haven't shown the activation bs yet (check that returns false, not true)

View file

@ -27,9 +27,7 @@ import com.tangem.domain.notifications.repository.NotificationsRepository
import com.tangem.domain.promo.ShouldShowPromoWalletUseCase import com.tangem.domain.promo.ShouldShowPromoWalletUseCase
import com.tangem.domain.promo.models.PromoId import com.tangem.domain.promo.models.PromoId
import com.tangem.domain.settings.IsReadyToShowRateAppUseCase import com.tangem.domain.settings.IsReadyToShowRateAppUseCase
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.usecase.IsNeedToBackupUseCase import com.tangem.domain.wallets.usecase.IsNeedToBackupUseCase
import com.tangem.domain.wallets.usecase.SeedPhraseNotificationUseCase
import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType import com.tangem.feature.wallet.child.wallet.model.WalletActivationBannerType
import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents
import com.tangem.feature.wallet.impl.R import com.tangem.feature.wallet.impl.R
@ -56,7 +54,6 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
private val isReadyToShowRateAppUseCase: IsReadyToShowRateAppUseCase, private val isReadyToShowRateAppUseCase: IsReadyToShowRateAppUseCase,
private val isNeedToBackupUseCase: IsNeedToBackupUseCase, private val isNeedToBackupUseCase: IsNeedToBackupUseCase,
private val backupValidator: BackupValidator, private val backupValidator: BackupValidator,
private val seedPhraseNotificationUseCase: SeedPhraseNotificationUseCase,
private val shouldShowPromoWalletUseCase: ShouldShowPromoWalletUseCase, private val shouldShowPromoWalletUseCase: ShouldShowPromoWalletUseCase,
private val notificationsRepository: NotificationsRepository, private val notificationsRepository: NotificationsRepository,
private val accountDependencies: AccountDependencies, private val accountDependencies: AccountDependencies,
@ -76,7 +73,6 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
accountStatusListFlow, accountStatusListFlow,
isReadyToShowRateAppUseCase().distinctUntilChanged(), isReadyToShowRateAppUseCase().distinctUntilChanged(),
isNeedToBackupUseCase(userWallet.walletId).distinctUntilChanged(), isNeedToBackupUseCase(userWallet.walletId).distinctUntilChanged(),
seedPhraseNotificationUseCase(userWalletId = userWallet.walletId).distinctUntilChanged(),
shouldShowPromoWalletUseCase(userWalletId = userWallet.walletId, promoId = PromoId.OnePlusOne) shouldShowPromoWalletUseCase(userWalletId = userWallet.walletId, promoId = PromoId.OnePlusOne)
.distinctUntilChanged(), .distinctUntilChanged(),
notificationsRepository.getShouldShowNotification(NotificationId.EnablePushesReminderNotification.key) notificationsRepository.getShouldShowNotification(NotificationId.EnablePushesReminderNotification.key)
@ -93,13 +89,12 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
val accountStatusList = array[0] as AccountStatusList val accountStatusList = array[0] as AccountStatusList
val isReadyToShowRating = array[1] as Boolean val isReadyToShowRating = array[1] as Boolean
val isNeedToBackup = array[2] as Boolean val isNeedToBackup = array[2] as Boolean
val seedPhraseIssueStatus = array[3] as SeedPhraseNotificationsStatus val shouldShowOnePlusOnePromo = array[3] as Boolean
val shouldShowOnePlusOnePromo = array[4] as Boolean val shouldShowEnablePushesReminderNotification = array[4] as Boolean
val shouldShowEnablePushesReminderNotification = array[5] as Boolean val shouldAccessCodeSkipped = array[5] as Boolean
val shouldAccessCodeSkipped = array[6] as Boolean val shouldShowYieldPromo = array[6] as Boolean
val shouldShowYieldPromo = array[7] as Boolean val shouldShowUpgradeBanner = array[7] as Boolean
val shouldShowUpgradeBanner = array[8] as Boolean val closureTimestamp = array[8] as? Long
val closureTimestamp = array[9] as? Long
val flattenCurrencies = accountStatusList.flattenCurrencies() val flattenCurrencies = accountStatusList.flattenCurrencies()
val paymentAccountStatus = accountStatusList.accountStatuses val paymentAccountStatus = accountStatusList.accountStatuses
@ -109,7 +104,7 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
buildList { buildList {
addUsedOutdatedDataNotification(accountStatusList.totalFiatBalance) addUsedOutdatedDataNotification(accountStatusList.totalFiatBalance)
addCriticalNotifications(userWallet, seedPhraseIssueStatus, clickIntents) addCriticalNotifications(userWallet, clickIntents)
addUpgradeHotWalletPromoNotification( addUpgradeHotWalletPromoNotification(
userWallet = userWallet, userWallet = userWallet,
@ -213,15 +208,12 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
private fun MutableList<WalletNotification>.addCriticalNotifications( private fun MutableList<WalletNotification>.addCriticalNotifications(
userWallet: UserWallet, userWallet: UserWallet,
seedPhraseIssueStatus: SeedPhraseNotificationsStatus,
clickIntents: WalletClickIntents, clickIntents: WalletClickIntents,
) { ) {
if (userWallet !is UserWallet.Cold) { if (userWallet !is UserWallet.Cold) {
return return
} }
addSeedNotificationIfNeeded(userWallet, seedPhraseIssueStatus, clickIntents)
val cardTypesResolver = userWallet.scanResponse.cardTypesResolver val cardTypesResolver = userWallet.scanResponse.cardTypesResolver
addIf( addIf(
element = WalletNotification.Critical.BackupError { clickIntents.onBackupErrorClick() }, element = WalletNotification.Critical.BackupError { clickIntents.onBackupErrorClick() },
@ -246,39 +238,6 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
} }
} }
private fun MutableList<WalletNotification>.addSeedNotificationIfNeeded(
userWallet: UserWallet.Cold,
seedPhraseIssueStatus: SeedPhraseNotificationsStatus,
clickIntents: WalletClickIntents,
) {
val isNotificationAvailable = with(userWallet) {
val isDemo = isDemoCardUseCase(cardId = userWallet.cardId)
val isWalletWithSeedPhrase = scanResponse.cardTypesResolver.isWallet2() && userWallet.isImported
!isDemo && isWalletWithSeedPhrase
}
when (seedPhraseIssueStatus) {
SeedPhraseNotificationsStatus.SHOW_FIRST -> addIf(
element = WalletNotification.Critical.SeedPhraseNotification(
onDeclineClick = clickIntents::onSeedPhraseNotificationDecline,
onConfirmClick = clickIntents::onSeedPhraseNotificationConfirm,
),
condition = isNotificationAvailable,
)
SeedPhraseNotificationsStatus.SHOW_SECOND -> addIf(
element = WalletNotification.Critical.SeedPhraseSecondNotification(
onDeclineClick = clickIntents::onSeedPhraseSecondNotificationReject,
onConfirmClick = clickIntents::onSeedPhraseSecondNotificationAccept,
),
condition = isNotificationAvailable,
)
SeedPhraseNotificationsStatus.NOT_NEEDED -> {
// do nothing
}
}
}
private fun MutableList<WalletNotification>.addInformationalNotifications( private fun MutableList<WalletNotification>.addInformationalNotifications(
userWallet: UserWallet, userWallet: UserWallet,
cardTypesResolver: CardTypesResolver?, cardTypesResolver: CardTypesResolver?,

View file

@ -14,9 +14,7 @@ import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.currency.CryptoCurrencyStatus
import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.models.wallet.isMultiCurrency import com.tangem.domain.models.wallet.isMultiCurrency
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.usecase.IsNeedToBackupUseCase import com.tangem.domain.wallets.usecase.IsNeedToBackupUseCase
import com.tangem.domain.wallets.usecase.SeedPhraseNotificationUseCase
import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents
import com.tangem.feature.wallet.presentation.account.AccountDependencies import com.tangem.feature.wallet.presentation.account.AccountDependencies
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotificationUM import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotificationUM
@ -40,7 +38,6 @@ internal class GetWalletNotificationsFactory @Inject constructor(
private val isDemoCardUseCase: IsDemoCardUseCase, private val isDemoCardUseCase: IsDemoCardUseCase,
private val isNeedToBackupUseCase: IsNeedToBackupUseCase, private val isNeedToBackupUseCase: IsNeedToBackupUseCase,
private val backupValidator: BackupValidator, private val backupValidator: BackupValidator,
private val seedPhraseNotificationUseCase: SeedPhraseNotificationUseCase,
private val accountDependencies: AccountDependencies, private val accountDependencies: AccountDependencies,
private val getAccessCodeSkippedUseCase: GetAccessCodeSkippedUseCase, private val getAccessCodeSkippedUseCase: GetAccessCodeSkippedUseCase,
private val hasSingleWalletSignedHashesUseCase: HasSingleWalletSignedHashesUseCase, private val hasSingleWalletSignedHashesUseCase: HasSingleWalletSignedHashesUseCase,
@ -54,16 +51,15 @@ internal class GetWalletNotificationsFactory @Inject constructor(
return combine( return combine(
flow = accountStatusListFlow, flow = accountStatusListFlow,
flow2 = isNeedToBackupUseCase(userWallet.walletId).distinctUntilChanged(), flow2 = isNeedToBackupUseCase(userWallet.walletId).distinctUntilChanged(),
flow3 = seedPhraseNotificationUseCase(userWalletId = userWallet.walletId).distinctUntilChanged(), flow3 = getAccessCodeSkippedUseCase(userWallet.walletId).distinctUntilChanged(),
flow4 = getAccessCodeSkippedUseCase(userWallet.walletId).distinctUntilChanged(), ) { accountList, isNeedToBackup, shouldAccessCodeSkipped ->
) { accountList, isNeedToBackup, seedPhraseIssueStatus, shouldAccessCodeSkipped ->
val totalFiatBalance = accountList.totalFiatBalance val totalFiatBalance = accountList.totalFiatBalance
val flattenCurrencies = accountList.flattenCurrencies() val flattenCurrencies = accountList.flattenCurrencies()
buildList { buildList {
addUsedOutdatedDataNotification(totalFiatBalance) addUsedOutdatedDataNotification(totalFiatBalance)
addCriticalNotifications(userWallet, seedPhraseIssueStatus, clickIntents) addCriticalNotifications(userWallet, clickIntents)
addFinishWalletActivationNotification( addFinishWalletActivationNotification(
userWallet = userWallet, userWallet = userWallet,
@ -99,15 +95,12 @@ internal class GetWalletNotificationsFactory @Inject constructor(
private fun MutableList<WalletNotificationUM>.addCriticalNotifications( private fun MutableList<WalletNotificationUM>.addCriticalNotifications(
userWallet: UserWallet, userWallet: UserWallet,
seedPhraseIssueStatus: SeedPhraseNotificationsStatus,
clickIntents: WalletClickIntents, clickIntents: WalletClickIntents,
) { ) {
if (userWallet !is UserWallet.Cold) { if (userWallet !is UserWallet.Cold) {
return return
} }
addSeedNotificationIfNeeded(userWallet, seedPhraseIssueStatus, clickIntents)
val cardTypesResolver = userWallet.scanResponse.cardTypesResolver val cardTypesResolver = userWallet.scanResponse.cardTypesResolver
addIf( addIf(
element = WalletNotificationUM.BackupError { clickIntents.onSupportClick() }, element = WalletNotificationUM.BackupError { clickIntents.onSupportClick() },
@ -279,37 +272,6 @@ internal class GetWalletNotificationsFactory @Inject constructor(
) )
} }
private fun MutableList<WalletNotificationUM>.addSeedNotificationIfNeeded(
userWallet: UserWallet.Cold,
seedPhraseIssueStatus: SeedPhraseNotificationsStatus,
clickIntents: WalletClickIntents,
) {
val isNotificationAvailable = with(userWallet) {
val isDemo = isDemoCardUseCase(cardId = userWallet.cardId)
val isWalletWithSeedPhrase = scanResponse.cardTypesResolver.isWallet2() && userWallet.isImported
!isDemo && isWalletWithSeedPhrase
}
when (seedPhraseIssueStatus) {
SeedPhraseNotificationsStatus.SHOW_FIRST -> addIf(
element = WalletNotificationUM.SeedPhraseNotification(
onDeclineClick = clickIntents::onSeedPhraseNotificationDecline,
onConfirmClick = clickIntents::onSeedPhraseNotificationConfirm,
),
condition = isNotificationAvailable,
)
SeedPhraseNotificationsStatus.SHOW_SECOND -> addIf(
element = WalletNotificationUM.SeedPhraseSecondNotification(
onDeclineClick = clickIntents::onSeedPhraseSecondNotificationReject,
onConfirmClick = clickIntents::onSeedPhraseSecondNotificationAccept,
),
condition = isNotificationAvailable,
)
SeedPhraseNotificationsStatus.NOT_NEEDED -> Unit
}
}
private suspend fun hasSignedHashes( private suspend fun hasSignedHashes(
selectedWallet: UserWallet, selectedWallet: UserWallet,
cryptoCurrencyStatus: CryptoCurrencyStatus?, cryptoCurrencyStatus: CryptoCurrencyStatus?,

View file

@ -9,24 +9,6 @@ import com.tangem.feature.wallet.impl.R
internal object WalletAlertUM { internal object WalletAlertUM {
fun seedPhraseConfirm(onClick: () -> Unit): DialogMessage {
return DialogMessage(
message = resourceReference(R.string.warning_seedphrase_issue_answer_yes),
firstActionBuilder = {
okAction(onClick = onClick)
},
)
}
fun seedPhraseDismiss(onClick: () -> Unit): DialogMessage {
return DialogMessage(
message = resourceReference(R.string.warning_seedphrase_issue_answer_no),
firstActionBuilder = {
okAction(onClick = onClick)
},
)
}
fun unableHideToken(cryptoCurrency: CryptoCurrency): DialogMessage { fun unableHideToken(cryptoCurrency: CryptoCurrency): DialogMessage {
return DialogMessage( return DialogMessage(
title = resourceReference( title = resourceReference(

View file

@ -55,34 +55,6 @@ sealed class WalletNotification(val config: NotificationConfig) {
onClick = onSupportClick, onClick = onSupportClick,
), ),
) )
data class SeedPhraseNotification(
val onDeclineClick: () -> Unit,
val onConfirmClick: () -> Unit,
) : Critical(
title = resourceReference(R.string.warning_seedphrase_issue_title),
subtitle = resourceReference(R.string.warning_seedphrase_issue_message),
buttonsState = NotificationConfig.ButtonsState.SecondaryPairButtonsConfig(
leftText = resourceReference(R.string.common_no),
onLeftClick = onDeclineClick,
rightText = resourceReference(R.string.common_yes),
onRightClick = onConfirmClick,
),
)
data class SeedPhraseSecondNotification(
val onDeclineClick: () -> Unit,
val onConfirmClick: () -> Unit,
) : Critical(
title = resourceReference(R.string.warning_seedphrase_action_required_title),
subtitle = resourceReference(R.string.warning_seedphrase_contacted_support),
buttonsState = NotificationConfig.ButtonsState.SecondaryPairButtonsConfig(
leftText = resourceReference(R.string.seed_warning_no),
onLeftClick = onDeclineClick,
rightText = resourceReference(R.string.seed_warning_yes),
onRightClick = onConfirmClick,
),
)
} }
sealed class Warning( sealed class Warning(

View file

@ -143,64 +143,6 @@ internal sealed class WalletNotificationUM(val messageUM: TangemMessageUM, val t
type = WalletNotificationType.Critical, type = WalletNotificationType.Critical,
) )
data class SeedPhraseNotification(
val onDeclineClick: () -> Unit,
val onConfirmClick: () -> Unit,
) : WalletNotificationUM(
messageUM = TangemMessageUM(
id = "SeedPhraseIssueNotification",
title = resourceReference(id = R.string.warning_seedphrase_issue_title),
subtitle = resourceReference(id = R.string.warning_seedphrase_issue_message),
messageEffect = TangemMessageEffect.Warning,
buttonsUM = persistentListOf(
TangemMessageButtonUM(
text = resourceReference(id = R.string.common_no),
type = TangemButtonType.PrimaryInverse,
onClick = onDeclineClick,
),
TangemMessageButtonUM(
text = resourceReference(id = R.string.common_yes),
type = TangemButtonType.PrimaryInverse,
onClick = onConfirmClick,
),
),
iconUM = TangemIconUM.Icon(
iconRes = R.drawable.ic_attention_default_24,
tintReference = { TangemTheme.colors2.graphic.neutral.primary },
),
),
type = WalletNotificationType.Critical,
)
data class SeedPhraseSecondNotification(
val onDeclineClick: () -> Unit,
val onConfirmClick: () -> Unit,
) : WalletNotificationUM(
messageUM = TangemMessageUM(
id = "SeedPhraseSecondIssueNotification",
title = resourceReference(id = R.string.warning_seedphrase_action_required_title),
subtitle = resourceReference(id = R.string.warning_seedphrase_contacted_support),
messageEffect = TangemMessageEffect.Warning,
iconUM = TangemIconUM.Icon(
iconRes = R.drawable.ic_attention_default_24,
tintReference = { TangemTheme.colors2.graphic.neutral.primary },
),
buttonsUM = persistentListOf(
TangemMessageButtonUM(
text = resourceReference(id = R.string.seed_warning_no),
type = TangemButtonType.PrimaryInverse,
onClick = onDeclineClick,
),
TangemMessageButtonUM(
text = resourceReference(id = R.string.seed_warning_yes),
type = TangemButtonType.PrimaryInverse,
onClick = onConfirmClick,
),
),
),
type = WalletNotificationType.Critical,
)
data class MissingBackup(val onClick: () -> Unit) : WalletNotificationUM( data class MissingBackup(val onClick: () -> Unit) : WalletNotificationUM(
messageUM = TangemMessageUM( messageUM = TangemMessageUM(
id = "MissingBackupNotification", id = "MissingBackupNotification",