Skip to content

Commit

Permalink
Corriger le problème de biométrie sans face-id (#199)
Browse files Browse the repository at this point in the history
Signed-off-by: ClaudeArs <claudears2474@gmail.com>
  • Loading branch information
ClaudeArs authored Jan 10, 2025
1 parent 4bee0c3 commit ffa9178
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/src/screens/UseBiometry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const UseBiometry: React.FC = () => {
switch (permissionResult) {
case RESULTS.GRANTED:
case RESULTS.LIMITED:
case RESULTS.UNAVAILABLE:
// Granted
onSwitchToggleAllowed(newToggleValue)
break
Expand Down Expand Up @@ -263,19 +264,20 @@ const UseBiometry: React.FC = () => {

// If the user is turning it on, they need
// to first authenticate the OS'es biometrics before this action is accepted
if (!biometryAvailable) {
setSettingsPopupConfig({
title: t('Biometry.SetupBiometricsTitle'),
description: t('Biometry.SetupBiometricsDesc'),
})
return
}
const permissionResult: PermissionStatus = await onCheckSystemBiometrics()
switch (permissionResult) {
case RESULTS.GRANTED:
case RESULTS.LIMITED:
// Already granted
onSwitchToggleAllowed(newValue)
break
case RESULTS.UNAVAILABLE:
setSettingsPopupConfig({
title: t('Biometry.SetupBiometricsTitle'),
description: t('Biometry.SetupBiometricsDesc'),
})
break
case RESULTS.BLOCKED:
// Previously denied
setSettingsPopupConfig({
Expand All @@ -284,6 +286,7 @@ const UseBiometry: React.FC = () => {
})
break
case RESULTS.DENIED:
case RESULTS.UNAVAILABLE:
// Has not been requested
await onRequestSystemBiometrics(newValue)
break
Expand Down

0 comments on commit ffa9178

Please sign in to comment.