Skip to content

Commit

Permalink
feat(ui): add success message after setup biometric authentication du…
Browse files Browse the repository at this point in the history
…ring onboarding
  • Loading branch information
Vu Van Duc authored and Vu Van Duc committed May 23, 2024
1 parent f45e214 commit 7c21bc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,8 @@
"unableconnectwallet": "Unable to connect",
"peeridsuccess": "Peer ID successful",
"peeridnotrecognised": "Peer ID not recognised",
"disconnectwallet": "Disconnected successfully",
"strongbiometrynotavailable": "Strong biometry not available"
"strongbiometrynotavailable": "Strong biometry not available",
"setupbiometricsuccess": "Biometrics setup successfully"
},
"request": {
"signtransaction": {
Expand Down
1 change: 1 addition & 0 deletions src/ui/globals/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ enum ToastMsgType {
UNABLE_CONNECT_WALLET = "unableconnectwallet",
PEER_ID_SUCCESS = "peeridsuccess",
PEER_ID_NOT_RECOGNISED = "peeridnotrecognised",
SETUP_BIOMETRIC_AUTHENTICATION_SUCCESS = "setupbiometricsuccess",
}

const IDENTIFIER_BG_MAPPING: Record<number, unknown> = {
Expand Down
5 changes: 5 additions & 0 deletions src/ui/pages/SetPasscode/SetPasscode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { PasscodeModule } from "../../components/PasscodeModule";
import {
getStateCache,
setInitialized,
setToastMsg,
} from "../../../store/reducers/stateCache";
import { useAppDispatch, useAppSelector } from "../../../store/hooks";
import { getNextRoute } from "../../../routes/nextRoute";
Expand All @@ -27,6 +28,7 @@ import { BiometryError } from "@aparajita/capacitor-biometric-auth/dist/esm/defi
import { getPlatforms } from "@ionic/react";
import { Alert } from "../../components/Alert";
import { useBiometricAuth } from "../../hooks/useBiometricsHook";
import { ToastMsgType } from "../../globals/types";

const SetPasscode = () => {
const pageId = "set-passcode";
Expand Down Expand Up @@ -76,6 +78,9 @@ const SetPasscode = () => {
const processBiometrics = async () => {
const isBiometricAuthenticated = await handleBiometricAuth();
if (isBiometricAuthenticated === true) {
dispatch(
setToastMsg(ToastMsgType.SETUP_BIOMETRIC_AUTHENTICATION_SUCCESS)
);
await PreferencesStorage.set(PreferencesKeys.APP_BIOMETRY, {
enabled: true,
});
Expand Down

0 comments on commit 7c21bc7

Please sign in to comment.