Skip to content

Commit

Permalink
Reorder call to setOrLoadInitialBackstack to resolve issues with rest…
Browse files Browse the repository at this point in the history
…oration order that was causing issues with composable containers hosted in fragments
  • Loading branch information
isaac-udy committed Feb 13, 2023
1 parent 880f27e commit 45b34ee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public class FragmentNavigationContainer internal constructor(
}
}, false)

setOrLoadInitialBackstack(initialBackstack)

val savedStateRegistry = parentContext.savedStateRegistryOwner.savedStateRegistry
savedStateRegistry.unregisterSavedStateProvider(key.name + ".ownedFragments")
savedStateRegistry.registerSavedStateProvider(key.name + ".ownedFragments") {
Expand All @@ -83,7 +85,6 @@ public class FragmentNavigationContainer internal constructor(
initialise()
}
} else initialise()
setOrLoadInitialBackstack(initialBackstack)
}

override fun onBackstackUpdated(
Expand Down

0 comments on commit 45b34ee

Please sign in to comment.