Optimize navigation back stack

Fix topjohnwu#4333

Co-authored-by: LoveSy <shana@zju.edu.cn>
This commit is contained in:
canyie
2022-01-20 03:38:00 -08:00
committed by John Wu
co-authored by LoveSy
parent 1f5992f2c2
commit b0fba6ce5b
4 changed files with 9 additions and 8 deletions
@@ -98,8 +98,8 @@ abstract class BaseViewModel(
_viewEvents.postValue(this)
}
fun NavDirections.navigate() {
_viewEvents.postValue(NavigationEvent(this))
fun NavDirections.navigate(pop: Boolean = false) {
_viewEvents.postValue(NavigationEvent(this, pop))
}
}