Skip to content

Commit

Permalink
Add fallback close for Send Confirm view
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelekol committed Nov 27, 2023
1 parent 8665527 commit 4625b12
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import io.horizontalsystems.bankwallet.modules.contacts.model.Contact
import io.horizontalsystems.bankwallet.modules.fee.HSFeeInputRaw
import io.horizontalsystems.bankwallet.modules.hodler.HSHodler
import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme
import io.horizontalsystems.bankwallet.ui.compose.DisposableLifecycleCallbacks
import io.horizontalsystems.bankwallet.ui.compose.components.AppBar
import io.horizontalsystems.bankwallet.ui.compose.components.ButtonPrimaryYellow
import io.horizontalsystems.bankwallet.ui.compose.components.CellUniversalLawrenceSection
Expand Down Expand Up @@ -106,10 +107,19 @@ fun SendConfirmationScreen(
LaunchedEffect(sendResult) {
if (sendResult == SendResult.Sent) {
delay(1200)
navController.popBackStack(closeUntilDestId, true)
navController.popBackStack(closeUntilDestId, true).not()
}
}

DisposableLifecycleCallbacks(
//additional close for cases when user closes app immediately after sending
onResume = {
if (sendResult == SendResult.Sent) {
navController.popBackStack(closeUntilDestId, true)
}
}
)

Column(Modifier.background(color = ComposeAppTheme.colors.tyler)) {
AppBar(
title = stringResource(R.string.Send_Confirmation_Title),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import io.horizontalsystems.bankwallet.modules.send.ConfirmAmountCell
import io.horizontalsystems.bankwallet.modules.send.MemoCell
import io.horizontalsystems.bankwallet.modules.send.SendResult
import io.horizontalsystems.bankwallet.ui.compose.ComposeAppTheme
import io.horizontalsystems.bankwallet.ui.compose.DisposableLifecycleCallbacks
import io.horizontalsystems.bankwallet.ui.compose.components.AppBar
import io.horizontalsystems.bankwallet.ui.compose.components.ButtonPrimaryYellow
import io.horizontalsystems.bankwallet.ui.compose.components.CellUniversalLawrenceSection
Expand Down Expand Up @@ -127,6 +128,15 @@ fun SendTronConfirmationScreen(
}
}

DisposableLifecycleCallbacks(
//additional close for cases when user closes app immediately after sending
onResume = {
if (sendResult == SendResult.Sent) {
navController.popBackStack(closeUntilDestId, true)
}
}
)

Column(Modifier.background(color = ComposeAppTheme.colors.tyler)) {
AppBar(
title = stringResource(R.string.Send_Confirmation_Title),
Expand Down

0 comments on commit 4625b12

Please sign in to comment.