We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0083464 commit b61c73bCopy full SHA for b61c73b
presentation/src/main/java/com/threegap/bitnagil/presentation/setting/SettingViewModel.kt
@@ -77,14 +77,19 @@ class SettingViewModel @Inject constructor(
77
}
78
79
fun logout() {
80
+ if (container.stateFlow.value.loading) return
81
+
82
sendIntent(SettingIntent.HideConfirmDialog)
83
viewModelScope.launch {
84
sendIntent(SettingIntent.LogoutLoading)
- logoutUseCase().onSuccess {
- sendIntent(SettingIntent.LogoutSuccess)
85
- }.onFailure {
86
- sendIntent(SettingIntent.LogoutFailure)
87
- }
+ logoutUseCase().fold(
+ onSuccess = {
+ sendIntent(SettingIntent.LogoutSuccess)
88
+ },
89
+ onFailure = {
90
+ sendIntent(SettingIntent.LogoutFailure)
91
92
+ )
93
94
95
0 commit comments