Skip to content

Commit

Permalink
Ensure backstack is set correctly for exiting and lastInstruction as …
Browse files Browse the repository at this point in the history
…well as the main backstack
  • Loading branch information
isaac-udy committed Oct 18, 2022
1 parent 575751b commit 77a4513
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ internal fun NavigationBackstack.ensureOpeningTypeIsSet(
backstack = backstack.map {
if (it.internal.openingType != Any::class.java) return@map it

InstructionOpenedByInterceptor.intercept(
it,
parentContext,
requireNotNull(parentContext.controller.bindingForKeyType(it.navigationKey::class)),
)
},
lastInstruction = lastInstruction.let {
if (it !is AnyOpenInstruction) return@let it
if (it.internal.openingType != Any::class.java) return@let it

InstructionOpenedByInterceptor.intercept(
it,
parentContext,
requireNotNull(parentContext.controller.bindingForKeyType(it.navigationKey::class)),
)
},
exiting = exiting?.let {
if (it.internal.openingType != Any::class.java) return@let it

InstructionOpenedByInterceptor.intercept(
it,
parentContext,
Expand Down

0 comments on commit 77a4513

Please sign in to comment.