Merge pull request #1761 from HabitRPG/Fixes#1756

Fixes#1716 - Fix party launch not working reliably
This commit is contained in:
Phillip Thelen 2022-05-09 16:39:06 +02:00 committed by GitHub
commit be23d2952d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -287,9 +287,12 @@ open class MainActivity : BaseActivity(), SnackbarActivity {
MainNavigationController.setup(navigationController)
navigationController.addOnDestinationChangedListener { _, destination, arguments -> updateToolbarTitle(destination, arguments) }
if (launchScreen == "/party") {
if (viewModel.userViewModel.isUserInParty) {
MainNavigationController.navigate(R.id.partyFragment)
viewModel.user.observeOnce(this) {
if (viewModel.userViewModel.isUserInParty) {
MainNavigationController.navigate(R.id.partyFragment)
}
}
}
launchScreen = null