Skip to content

Commit 7d8f1c5

Browse files
NFC-83 Add readonly when remember me is on, if remember me is off then readonly is no applicable for signing
1 parent e51219e commit 7d8f1c5

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

app/src/main/kotlin/ee/ria/DigiDoc/fragment/screen/WebEidScreen.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fun WebEidScreen(
112112
val dialogError by viewModel.dialogError.asFlow().collectAsState(0)
113113
val showErrorDialog = rememberSaveable { mutableStateOf(false) }
114114
var rememberMe by rememberSaveable { mutableStateOf(true) }
115+
val hasStoredCanNumber = sharedSettingsViewModel.dataStore.getCanNumber().isNotEmpty()
115116

116117
LaunchedEffect(messages) {
117118
messages.forEach { message ->
@@ -316,6 +317,7 @@ fun WebEidScreen(
316317
NFCView(
317318
activity = activity,
318319
identityAction = IdentityAction.CERTIFICATE,
320+
rememberMe = rememberMe,
319321
isCertificate = true,
320322
showPinField = false,
321323
isSigning = false,
@@ -340,6 +342,15 @@ fun WebEidScreen(
340342
isAuthenticated = { _, _ -> },
341343
webEidViewModel = viewModel,
342344
)
345+
346+
if (!isWebEidAuthenticating) {
347+
Spacer(modifier = Modifier.height(SPadding))
348+
349+
WebEidRememberMe(
350+
rememberMe = rememberMe,
351+
onRememberMeChange = { rememberMe = it },
352+
)
353+
}
343354
} else {
344355
NFCView(
345356
activity = activity,
@@ -348,7 +359,7 @@ fun WebEidScreen(
348359
isSigning = false,
349360
isDecrypting = false,
350361
isWebEidAuthenticating = isWebEidAuthenticating,
351-
canNumberReadOnly = true,
362+
canNumberReadOnly = hasStoredCanNumber,
352363
onError = {
353364
isWebEidAuthenticating = false
354365
cancelWebEidSignAction()
@@ -471,7 +482,7 @@ private fun WebEidAuthInfo(authRequest: WebEidAuthRequest) {
471482
Spacer(modifier = Modifier.height(2.dp))
472483

473484
Text(
474-
text = "NAME, PERSONAL IDENTIFICATION CODE",
485+
text = stringResource(R.string.web_eid_name_personal_identification_code),
475486
style = MaterialTheme.typography.bodySmall,
476487
textAlign = TextAlign.Left,
477488
)
@@ -529,7 +540,7 @@ private fun WebEidSignOrCertificateInfo(
529540
Spacer(modifier = Modifier.height(2.dp))
530541

531542
Text(
532-
text = "NAME, PERSONAL IDENTIFICATION CODE",
543+
text = stringResource(R.string.web_eid_name_personal_identification_code),
533544
style = MaterialTheme.typography.bodySmall,
534545
textAlign = TextAlign.Left,
535546
)

app/src/main/res/values-et/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@
666666
<string name="web_eid_auth_consent_text">Autentides nõustun oma nime ja isikukoodi edastamisega teenusepakkujale.</string>
667667
<string name="web_eid_auth_request_from">Autentimispäring:</string>
668668
<string name="web_eid_details_forwarded">Edastatavad andmed:</string>
669+
<string name="web_eid_name_personal_identification_code">NIMI, ISIKUKOOD</string>
669670
<string name="web_eid_remember_me_message">Järgmisel kasutamisel on andmeväljad eeltäidetud.</string>
670671
<string name="web_eid_get_certificate">Kinnita</string>
671672
<string name="web_eid_certificate_title">Vali sertifikaat</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@
666666
<string name="web_eid_auth_consent_text">By authenticating, I agree to the transfer of my name and personal identification code to the service provider.</string>
667667
<string name="web_eid_auth_request_from">Authentication request from:</string>
668668
<string name="web_eid_details_forwarded">Details forwarded:</string>
669+
<string name="web_eid_name_personal_identification_code">NAME, PERSONAL IDENTIFICATION CODE</string>
669670
<string name="web_eid_remember_me_message">The entered data will be filled the next time you authenticate.</string>
670671
<string name="web_eid_get_certificate">Confirm</string>
671672
<string name="web_eid_certificate_title">Select a certificate</string>

0 commit comments

Comments
 (0)