mirror of
https://github.com/bitwarden/android.git
synced 2026-06-06 14:28:45 -05:00
BIT-1418: Add premium feature restriction notice to attachments (#787)
This commit is contained in:
committed by
Álison Fernandes
parent
064b767b56
commit
05bdf5a25e
@@ -47,12 +47,19 @@ class AttachmentsViewModel @Inject constructor(
|
||||
) : BaseViewModel<AttachmentsState, AttachmentsEvent, AttachmentsAction>(
|
||||
// We load the state from the savedStateHandle for testing purposes.
|
||||
initialState = savedStateHandle[KEY_STATE]
|
||||
?: AttachmentsState(
|
||||
cipherId = AttachmentsArgs(savedStateHandle).cipherId,
|
||||
viewState = AttachmentsState.ViewState.Loading,
|
||||
dialogState = null,
|
||||
isPremiumUser = authRepo.userStateFlow.value?.activeAccount?.isPremium == true,
|
||||
),
|
||||
?: run {
|
||||
val isPremiumUser = authRepo.userStateFlow.value?.activeAccount?.isPremium == true
|
||||
AttachmentsState(
|
||||
cipherId = AttachmentsArgs(savedStateHandle).cipherId,
|
||||
viewState = AttachmentsState.ViewState.Loading,
|
||||
dialogState = AttachmentsState.DialogState.Error(
|
||||
title = null,
|
||||
message = R.string.premium_required.asText(),
|
||||
)
|
||||
.takeUnless { isPremiumUser },
|
||||
isPremiumUser = isPremiumUser,
|
||||
)
|
||||
},
|
||||
) {
|
||||
init {
|
||||
vaultRepo
|
||||
|
||||
Reference in New Issue
Block a user