Navigate only if user has not left the fragment

This commit is contained in:
canyie 2022-05-28 21:57:50 +08:00 committed by John Wu
parent 490a784993
commit 0cc29350a0

View File

@ -83,7 +83,7 @@ abstract class BaseFragment<Binding : ViewDataBinding> : Fragment(), ViewModelHo
} }
fun NavDirections.navigate() { fun NavDirections.navigate() {
navigation?.navigate(this) navigation?.currentDestination?.getAction(actionId)?.let { navigation!!.navigate(this) }
} }
} }