Skip to content

Commit ee39d7a

Browse files
committed
refactor: navigation logic
1 parent 878969e commit ee39d7a

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

cmp-navigation/src/commonMain/kotlin/cmp/navigation/authenticated/AuthenticatedNavigation.kt

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,35 @@ fun NavController.navigateToStatusScreenWithoutPopUpTo(
395395
subtitle: String,
396396
buttonText: String,
397397
) {
398-
this.navigate(
399-
StatusNavigationRoute(
400-
eventType = eventType,
401-
eventDestination = eventDestination,
402-
title = title,
403-
subtitle = subtitle,
404-
buttonText = buttonText,
405-
),
406-
) {
407-
launchSingleTop = true
398+
if (eventDestination == StatusNavigationDestination.THIRD_PARTY_TRANSFER.name) {
399+
this.navigate(
400+
StatusNavigationRoute(
401+
eventType = eventType,
402+
eventDestination = eventDestination,
403+
title = title,
404+
subtitle = subtitle,
405+
buttonText = buttonText,
406+
),
407+
) {
408+
if (eventType == EventType.SUCCESS.name) {
409+
popUpTo(AuthenticatedGraphRoute) {
410+
inclusive = true
411+
}
412+
launchSingleTop = true
413+
}
414+
}
415+
} else {
416+
this.navigate(
417+
StatusNavigationRoute(
418+
eventType = eventType,
419+
eventDestination = eventDestination,
420+
title = title,
421+
subtitle = subtitle,
422+
buttonText = buttonText,
423+
),
424+
) {
425+
launchSingleTop = true
426+
}
408427
}
409428
}
410429

0 commit comments

Comments
 (0)