Last active
June 7, 2025 16:54
-
-
Save euri16/bced732966e3ecf8afcec7fca786c684 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun deleteAccount() { | |
viewModelScope.launch { | |
// ... | |
try { | |
userRepository.deleteAccount() | |
_uiState.update { | |
it.copy( | |
isLoading = false, | |
effect = UserProfileEffect.NavigateToLogin | |
) | |
} | |
} catch (exception: Exception) { | |
_uiState.update { | |
it.copy( | |
isLoading = false, | |
effect = UserProfileEffect.ShowError(message = "An error occurred") | |
) | |
} | |
} | |
} | |
} | |
private fun consumeEffect() { | |
_uiState.update { it.copy(effect = null) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment