TP-66425 | lite back-press when opened from pps/tds check-bal (#10893)
This commit is contained in:
@@ -118,8 +118,7 @@ object NaviPayRouter {
|
||||
val screenIdentifier = url.split("/").last()
|
||||
return when (screenIdentifier) {
|
||||
NaviPayScreenType.NAVI_PAY_QR_SCANNER_SCREEN.name -> QrScannerScreenDestination
|
||||
NaviPayScreenType.NAVI_PAY_UPI_LITE.name ->
|
||||
UPILiteScreenDestination(shouldNavigateUp = false)
|
||||
NaviPayScreenType.NAVI_PAY_UPI_LITE.name -> UPILiteScreenDestination()
|
||||
NaviPayScreenType.NAVI_PAY_CHECK_BALANCE.name ->
|
||||
LinkedAccountsScreenDestination(isIntentOfTypeCheckBalance = true)
|
||||
NaviPayScreenType.NAVI_PAY_CHECK_PRIMARY_BALANCE.name ->
|
||||
|
||||
@@ -21,6 +21,7 @@ import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import androidx.compose.ui.ExperimentalComposeUiApi
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
@@ -56,12 +57,12 @@ import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Destination
|
||||
@OptIn(ExperimentalMaterialApi::class)
|
||||
@OptIn(ExperimentalMaterialApi::class, ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
fun UPILiteScreen(
|
||||
naviPayActivity: NaviPayActivity,
|
||||
navigator: DestinationsNavigator,
|
||||
shouldNavigateUp: Boolean = true,
|
||||
shouldNavigateUp: Boolean = false,
|
||||
upiLiteViewModel: UPILiteViewModel = hiltViewModel(),
|
||||
naviPayAnalytics: NaviPayAnalytics.NaviPayUPILite = NaviPayAnalytics.INSTANCE.NaviPayUPILite()
|
||||
) {
|
||||
@@ -128,12 +129,11 @@ fun UPILiteScreen(
|
||||
val closeSheet = { upiLiteViewModel.updateBottomSheetUIState(showBottomSheet = false) }
|
||||
|
||||
val onBackClick = {
|
||||
if (naviPayActivity.needsResult || !shouldNavigateUp) {
|
||||
if (shouldNavigateUp || !naviPayActivity.needsResult) {
|
||||
upiLiteViewModel.handleBackPress()
|
||||
} else {
|
||||
navigator.navigateUp()
|
||||
naviPayActivity.finish()
|
||||
}
|
||||
Unit
|
||||
}
|
||||
|
||||
BackHandler {
|
||||
@@ -175,11 +175,7 @@ fun UPILiteScreen(
|
||||
// Do nothing, back press is disabled for N seconds when top-up is in progress
|
||||
}
|
||||
is UpiLiteBackPressAction.GoBack -> {
|
||||
if (naviPayActivity.needsResult) {
|
||||
naviPayActivity.finish()
|
||||
} else {
|
||||
navigator.navigateUp()
|
||||
}
|
||||
navigator.navigateUp()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ constructor(
|
||||
?.categoryTags
|
||||
?.contains(TransactionCategoryTags.UPI_LITE_ADD_MONEY_AND_CLOSURE.value) ==
|
||||
true -> {
|
||||
updateNavigationToNextScreen(UPILiteScreenDestination())
|
||||
updateNavigationToNextScreen(UPILiteScreenDestination(shouldNavigateUp = true))
|
||||
}
|
||||
transactionEntity.value
|
||||
?.categoryTags
|
||||
|
||||
Reference in New Issue
Block a user