Updated on 2026-08-14

This commit is contained in:
Tangem 2025-08-19 18:01:55 +07:00
parent 99a5efd7e2
commit 00171d2276
11 changed files with 102 additions and 7 deletions

View file

@ -177,7 +177,7 @@ private fun AlertContentDescription(alert: AlertsComponent.AlertType, modifier:
R.string.wc_alert_unsupported_method_description,
)
is AlertsComponent.AlertType.RequiredAddNetwork -> stringResourceSafe(
R.string.wc_alert_unsupported_method_description,
R.string.wc_alert_add_network_to_portfolio_description,
alert.network,
)
is AlertsComponent.AlertType.RequiredReconnectWithNetwork -> stringResourceSafe(

View file

@ -60,7 +60,9 @@ internal class WcAddNetworkModel @Inject constructor(
val either = useCase.invoke()
either
.onLeft { router.push(WcHandleMethodErrorConverter.convert(it)) }
.map { showUI() }
.map {
if (it.isExistInWcSession) cancel(useCase) else showUI()
}
}
}

View file

@ -35,7 +35,13 @@ internal class WcSwitchNetworkModel @Inject constructor(
useCase.reject()
either
.onLeft { showErrorDialog(it) }
.map { showErrorDialog(HandleMethodError.RequiredNetwork(it.network.name)) }
.map {
if (it.isExistInWcSession) {
router.pop()
} else {
showErrorDialog(HandleMethodError.RequiredNetwork(it.network.name))
}
}
}
}