Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-28 16:12:55 +05:00
parent 27b6caeaeb
commit 3f55454b65
3 changed files with 6 additions and 1 deletions

View file

@ -228,7 +228,8 @@ internal class WalletModel @Inject constructor(
if (selectedWallet.isMultiCurrency) {
selectedWalletAnalyticsSender.send(selectedWallet)
}
// Registering here, because `WalletDeepLinksHandler` unregisters deeplink when scope is cancelled
// This is temporary solution, will be removed with complete deeplink navigation overhaul
addReferralDeepLink(selectedWallet)
walletDeepLinksHandler.registerForWallet(scope = modelScope, userWallet = selectedWallet)
}

View file

@ -38,6 +38,7 @@ internal class WalletDeepLinksHandler @Inject constructor(
deepLinksRegistry.unregisterByIds(deepLinks.map { it.id })
deepLinksRegistry.register(deepLinks = deepLinks)
// When navigation to another screen scope is Cancelled and deeplinks are hot handled
scope.launchOnCancellation {
deepLinksRegistry.unregister(deepLinks)
}

View file

@ -115,9 +115,12 @@ internal abstract class BasicTokenListSubscriber(
protected open suspend fun onTokenListReceived(maybeTokenList: Lce<TokenListError, TokenList>) {
/* no-op */
// Handling sell deeplink requires full content in order to correctly open Send screen
if (maybeTokenList.getOrNull(false) != null) {
deepLinksRegistry.triggerDelayedDeeplink(deepLinkClass = SellCurrencyDeepLink::class.java)
}
// Handling referral deeplink requires only selected wallet to be loaded
// This is temporary solution, will be removed with complete deeplink navigation overhaul
if (maybeTokenList.getOrNull(true) != null) {
deepLinksRegistry.triggerDelayedDeeplink(deepLinkClass = ReferralDeepLink::class.java)
}