updated the code
This commit is contained in:
@@ -15,14 +15,10 @@ class SettingsViewModel @Inject constructor(
|
|||||||
private val loginDataStore: LoginDataStore,
|
private val loginDataStore: LoginDataStore,
|
||||||
private val firebaseFirestore: FirebaseFirestore
|
private val firebaseFirestore: FirebaseFirestore
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
private val _isLoggedIn = MutableStateFlow(false)
|
|
||||||
val isLoggedIn = _isLoggedIn.asStateFlow()
|
|
||||||
|
|
||||||
|
|
||||||
fun logout() {
|
fun logout() {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
loginDataStore.clearLoginData()
|
loginDataStore.clearLoginData()
|
||||||
_isLoggedIn.value = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user