ui: mitigate navigation desync bug

This thing reared it's ugly head again during 3.2.0 testing. I think
I've found a terrible but probably functional workaround for it. Start
using it.
This commit is contained in:
Alexander Capehart 2023-08-16 19:20:21 -06:00
parent 449ec7cecd
commit f400aa513c
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -148,6 +148,14 @@ class MainFragment :
}
}
// Workaround for a bug where fast navigation ends up desynchronizing the current
// destination in the main navigation graph.
findNavController().apply {
findDestination(R.id.main_fragment)?.let {
currentBackStackEntry?.destination = it
}
}
// --- VIEWMODEL SETUP ---
collectImmediately(detailModel.editedPlaylist, detailBackCallback::invalidateEnabled)
collectImmediately(homeModel.showOuter.flow, ::handleShowOuter)