mirror of
https://github.com/bitwarden/android.git
synced 2026-06-08 08:06:32 -05:00
Add 'isPremium' boolean to account info (#278)
This commit is contained in:
committed by
Álison Fernandes
parent
636600114b
commit
acfc39ae3c
@@ -31,6 +31,7 @@ data class UserState(
|
||||
* @property email The user's email address.
|
||||
* @property name The user's name (if applicable).
|
||||
* @property avatarColorHex Hex color value for a user's avatar in the "#AARRGGBB" format.
|
||||
* @property isPremium `true` if the account has a premium membership.
|
||||
* @property isVaultUnlocked Whether or not the user's vault is currently unlocked.
|
||||
*/
|
||||
data class Account(
|
||||
@@ -38,6 +39,7 @@ data class UserState(
|
||||
val name: String?,
|
||||
val email: String,
|
||||
val avatarColorHex: String,
|
||||
val isPremium: Boolean,
|
||||
val isVaultUnlocked: Boolean,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ fun UserStateJson.toUserState(
|
||||
email = accountJson.profile.email,
|
||||
// TODO Calculate default color (BIT-1191)
|
||||
avatarColorHex = accountJson.profile.avatarColorHex ?: "#00aaaa",
|
||||
isPremium = accountJson.profile.hasPremium == true,
|
||||
isVaultUnlocked = userId in vaultState.unlockedVaultUserIds,
|
||||
)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user