Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 958cb182 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

App lounge: (issue_5168) create function clearUserType() in DataStoreModule

parent 86f9be0f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class DataStoreModule @Inject constructor(
     *
     * Modification for issue: https://gitlab.e.foundation/e/backlog/-/issues/5168
     * Previously this method would also remove [USERTYPE].
     * But now it is only to be done from [saveUserType] passing [User.UNAVAILABLE] when clicking logout.
     * To clear this value, call [clearUserType].
     */
    suspend fun destroyCredentials() {
        context.dataStore.edit {
@@ -79,6 +79,12 @@ class DataStoreModule @Inject constructor(
        }
    }

    suspend fun clearUserType() {
        context.dataStore.edit {
            it.remove(USERTYPE)
        }
    }

    /**
     * TOC status
     */