Skip to content

Commit

Permalink
Merge pull request #200 from hotwired/fix-navhost-reset
Browse files Browse the repository at this point in the history
Ensure the WebView is detached before resetting the NavHostFragment
  • Loading branch information
jayohms authored Oct 20, 2021
2 parents f01b3b5 + d17ef8b commit 03de250
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ abstract class TurboSessionNavHostFragment : NavHostFragment() {
}

fun reset(onReset: () -> Unit = {}) {
currentNavDestination.clearBackStack {
session.reset()
initControllerGraph()
onReset()
currentNavDestination.delegate().navigator.onNavigationVisit {
currentNavDestination.clearBackStack {
session.reset()
initControllerGraph()
onReset()
}
}
}

Expand Down

0 comments on commit 03de250

Please sign in to comment.