File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
app/src/main/kotlin/ee/ria/DigiDoc Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -789,7 +789,7 @@ fun EncryptNavigation(
789789 leftActionButtonName = R .string.sign_button,
790790 rightActionButtonName = rightActionButtonName,
791791 leftActionButtonContentDescription = R .string.sign_button,
792- rightActionButtonContentDescription = R .string.decrypt_button_accessibility ,
792+ rightActionButtonContentDescription = rightActionButtonName ,
793793 onLeftActionButtonClick = onSignActionClick,
794794 onRightActionButtonClick = {
795795 if (encryptViewModel.isDecryptButtonShown(cryptoContainer, isNestedContainer)) {
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ import androidx.compose.ui.ExperimentalComposeUiApi
5252import androidx.compose.ui.Modifier
5353import androidx.compose.ui.graphics.toArgb
5454import androidx.compose.ui.graphics.vector.ImageVector
55- import androidx.compose.ui.platform.LocalContext
5655import androidx.compose.ui.platform.testTag
5756import androidx.compose.ui.res.stringResource
5857import androidx.compose.ui.res.vectorResource
@@ -87,9 +86,12 @@ fun ContainerNameView(
8786 onRightActionButtonClick : () -> Unit = {},
8887 onMoreOptionsActionButtonClick : () -> Unit = {},
8988) {
90- val context = LocalContext .current
9189 val leftActionButtonContentDescriptionText = stringResource(leftActionButtonContentDescription)
92- val rightActionButtonContentDescriptionText = stringResource(rightActionButtonContentDescription)
90+
91+ var rightActionButtonContentDescriptionText = " "
92+ if (showRightActionButton) {
93+ rightActionButtonContentDescriptionText = stringResource(rightActionButtonContentDescription)
94+ }
9395
9496 val containerTitleText = stringResource(R .string.container_title)
9597
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import ee.ria.DigiDoc.viewmodel.shared.SharedContainerViewModel
4545import kotlinx.coroutines.Dispatchers.Main
4646import kotlinx.coroutines.withContext
4747import java.io.File
48+ import java.util.Date
4849import javax.inject.Inject
4950
5051@HiltViewModel
@@ -99,7 +100,20 @@ class EncryptViewModel
99100 fun isDecryptButtonShown (
100101 cryptoContainer : CryptoContainer ? ,
101102 isNestedContainer : Boolean ,
102- ): Boolean = isEncryptedContainer(cryptoContainer) && ! isNestedContainer
103+ ): Boolean {
104+ val base = isEncryptedContainer(cryptoContainer) && ! isNestedContainer
105+ if (! base) return false
106+
107+ val now = Date ()
108+ val allExpired =
109+ cryptoContainer
110+ ?.recipients
111+ ?.all { recipient ->
112+ recipient.validTo?.before(now) == true
113+ } ? : false
114+
115+ return ! allExpired
116+ }
103117
104118 fun isEncryptButtonShown (
105119 cryptoContainer : CryptoContainer ? ,
You can’t perform that action at this time.
0 commit comments