Updated on 2026-08-14
This commit is contained in:
parent
b8fc2d4f76
commit
283e760a4b
15 changed files with 68 additions and 6 deletions
|
|
@ -364,7 +364,8 @@ sealed class AppRoute(val path: String) : Route {
|
|||
@Serializable
|
||||
data class CreateWalletBackup(
|
||||
val userWalletId: UserWalletId,
|
||||
val isUpgradeFlow: Boolean,
|
||||
val isUpgradeFlow: Boolean = false,
|
||||
val setAccessCode: Boolean = false,
|
||||
) : AppRoute(path = "/create_wallet_backup/${userWalletId.stringValue}")
|
||||
|
||||
@Serializable
|
||||
|
|
|
|||
|
|
@ -30,6 +30,19 @@ interface AppRouter {
|
|||
},
|
||||
)
|
||||
|
||||
/**
|
||||
* Replaces a current route with a new one.
|
||||
*
|
||||
* @param route The route to replace a current one.
|
||||
* @param onComplete The callback to be invoked when the operation is complete.
|
||||
*/
|
||||
fun replaceCurrent(
|
||||
route: AppRoute,
|
||||
onComplete: (isSuccess: Boolean) -> Unit = { isSuccess ->
|
||||
defaultCompletionHandler(isSuccess, errorMessage = "Unable to replace a current route with $route")
|
||||
},
|
||||
)
|
||||
|
||||
/**
|
||||
* Replaces ***all*** routes in the navigation stack with the specified [routes].
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@ private class RouterProxy(
|
|||
}
|
||||
}
|
||||
|
||||
override fun replaceCurrent(route: Route, onComplete: (Boolean) -> Unit) {
|
||||
if (route is AppRoute) {
|
||||
appRouter.replaceCurrent(route, onComplete)
|
||||
}
|
||||
}
|
||||
|
||||
override fun replaceAll(vararg routes: Route, onComplete: (isSuccess: Boolean) -> Unit) {
|
||||
routes.filterIsInstance<AppRoute>().let {
|
||||
appRouter.replaceAll(*it.toTypedArray(), onComplete = onComplete)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue