Updated on 2026-08-14

This commit is contained in:
Tangem 2022-09-19 08:26:45 +04:00
commit 1e73bd9f72
3 changed files with 12 additions and 4 deletions

View file

@ -12,6 +12,9 @@ class WalletConnectNetworkUtils {
peer: WCPeerMeta,
): Blockchain? {
return when {
peer.url.contains("pancakeswap.finance") -> {
Blockchain.BSC
}
chainId != null -> {
Blockchain.fromChainId(chainId)
}

View file

@ -97,14 +97,16 @@ class DetailsMiddleware {
fun handle(action: DetailsAction.ResetToFactory) {
when (action) {
is DetailsAction.ResetToFactory.Start -> {
store.dispatch(NavigationAction.NavigateTo(AppScreen.ResetToFactory))
}
is DetailsAction.ResetToFactory.Proceed -> {
val card = store.state.detailsState.cardSettingsState?.card ?: return
if (card.isTangemTwins()) {
store.dispatch(DetailsAction.ReCreateTwinsWallet)
return
} else {
store.dispatch(NavigationAction.NavigateTo(AppScreen.ResetToFactory))
}
}
is DetailsAction.ResetToFactory.Proceed -> {
val card = store.state.detailsState.cardSettingsState?.card ?: return
scope.launch {
val result = tangemSdkManager.resetToFactorySettings(card)
when (result) {

View file

@ -220,7 +220,10 @@ class WalletConnectMiddleware {
val blockchain = WalletConnectNetworkUtils.parseBlockchain(
chainId = chainId,
peer = session.peerMeta,
) ?: Blockchain.Ethereum
).guard {
store.dispatchOnMain(GlobalAction.ShowDialog(WalletConnectDialog.UnsupportedNetwork))
return
}
handleScanResponse(scanResponse = scanResponse, session = session, blockchain = blockchain)
}