Replace if with when in SplashViewModel
This commit is contained in:
@@ -23,12 +23,11 @@ class SplashViewModel @Inject constructor(
|
|||||||
init {
|
init {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
delay(1000)
|
delay(1000)
|
||||||
_nextDestination.value = if (!disclaimerStorage.isDisclaimerAccepted())
|
_nextDestination.value = when {
|
||||||
SplashFragmentDirections.actionSplashFragmentToDisclaimerFragment()
|
!disclaimerStorage.isDisclaimerAccepted() -> SplashFragmentDirections.actionSplashFragmentToDisclaimerFragment()
|
||||||
else if (baseURLStorage.getBaseURL() == null)
|
baseURLStorage.getBaseURL() == null -> SplashFragmentDirections.actionSplashFragmentToBaseURLFragment()
|
||||||
SplashFragmentDirections.actionSplashFragmentToBaseURLFragment()
|
else -> SplashFragmentDirections.actionSplashFragmentToRecipesFragment()
|
||||||
else
|
}
|
||||||
SplashFragmentDirections.actionSplashFragmentToRecipesFragment()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user