Updated on 2026-08-14
This commit is contained in:
parent
8f69b1dce3
commit
5adb9506b2
4 changed files with 23 additions and 8 deletions
|
|
@ -12,6 +12,7 @@ import com.arkivanov.decompose.router.stack.pop
|
|||
import com.arkivanov.decompose.value.ObserveLifecycleMode
|
||||
import com.arkivanov.decompose.value.subscribe
|
||||
import com.tangem.common.ui.amountScreen.models.AmountState
|
||||
import com.tangem.common.ui.navigationButtons.NavigationUM
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.decompose.context.AppComponentContext
|
||||
import com.tangem.core.decompose.context.child
|
||||
|
|
@ -125,7 +126,11 @@ internal class DefaultSendComponent @AssistedInject constructor(
|
|||
val stackState by childStack.subscribeAsState()
|
||||
val state by model.uiState.collectAsStateWithLifecycle()
|
||||
|
||||
BackHandler(onBack = ::onChildBack)
|
||||
BackHandler(
|
||||
onBack = {
|
||||
(state.navigationUM as? NavigationUM.Content)?.backIconClick() ?: onChildBack()
|
||||
},
|
||||
)
|
||||
SendContent(
|
||||
navigationUM = state.navigationUM,
|
||||
stackState = stackState,
|
||||
|
|
|
|||
|
|
@ -594,7 +594,11 @@ internal class SendConfirmModel @Inject constructor(
|
|||
isValid = confirmUM.isPrimaryButtonEnabled,
|
||||
),
|
||||
)
|
||||
appRouter.pop()
|
||||
if (state.isRedesignEnabled) {
|
||||
router.pop()
|
||||
} else {
|
||||
appRouter.pop()
|
||||
}
|
||||
},
|
||||
primaryButton = primaryButtonUM(),
|
||||
prevButton = null,
|
||||
|
|
|
|||
|
|
@ -145,6 +145,11 @@ internal class SendDestinationModel @Inject constructor(
|
|||
)
|
||||
}
|
||||
|
||||
fun saveResult() {
|
||||
val params = params as? SendDestinationComponentParams.DestinationParams ?: return
|
||||
params.callback.onDestinationResult(uiState.value)
|
||||
}
|
||||
|
||||
private fun initSenderAddress() {
|
||||
modelScope.launch {
|
||||
senderAddresses.value = getNetworkAddressesUseCase.invokeSync(
|
||||
|
|
@ -288,11 +293,6 @@ internal class SendDestinationModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun saveResult() {
|
||||
val params = params as? SendDestinationComponentParams.DestinationParams ?: return
|
||||
params.callback.onDestinationResult(uiState.value)
|
||||
}
|
||||
|
||||
@Suppress("LongMethod")
|
||||
private fun configDestinationNavigation() {
|
||||
val params = params as? SendDestinationComponentParams.DestinationParams ?: return
|
||||
|
|
@ -321,6 +321,7 @@ internal class SendDestinationModel @Inject constructor(
|
|||
isValid = state.isPrimaryButtonEnabled,
|
||||
),
|
||||
)
|
||||
saveResult()
|
||||
}
|
||||
params.callback.onBackClick()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.arkivanov.decompose.router.stack.childStack
|
|||
import com.arkivanov.decompose.router.stack.pop
|
||||
import com.arkivanov.decompose.value.ObserveLifecycleMode
|
||||
import com.arkivanov.decompose.value.subscribe
|
||||
import com.tangem.common.ui.navigationButtons.NavigationUM
|
||||
import com.tangem.core.decompose.context.AppComponentContext
|
||||
import com.tangem.core.decompose.context.childByContext
|
||||
import com.tangem.core.decompose.model.getOrCreateModel
|
||||
|
|
@ -101,7 +102,11 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor(
|
|||
val stackState by childStack.subscribeAsState()
|
||||
val state by model.uiState.collectAsStateWithLifecycle()
|
||||
|
||||
BackHandler(onBack = ::onChildBack)
|
||||
BackHandler(
|
||||
onBack = {
|
||||
(state.navigationUM as? NavigationUM.Content)?.backIconClick() ?: onChildBack()
|
||||
},
|
||||
)
|
||||
SendWithSwapContent(navigationUM = state.navigationUM, stackState = stackState)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue