Skip to content

Commit f15f703

Browse files
author
Guru
committed
fix: handle errors
1 parent e59bbe8 commit f15f703

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

demo/redirect-flow-example/src/components/mfa-cards/authenticator/AuthenticatorScan.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ const AuthenticatorQRCodeCard: React.FC = () => {
164164
setDrawerInfo("Authenticator has been set successfully");
165165
} catch (error) {
166166
console.error(error);
167+
setDrawerHeading(`Authenticator`);
168+
setDrawerInfo(`Error Setting Authenticator: ${(error as Error).message || "Failed"}`);
167169
} finally {
168170
setIsLoading(false);
169171
}

demo/redirect-flow-example/src/components/mfa-cards/mnemonic/CreateMnemonic.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ const CreateMnemonicPhraseCard: React.FC = () => {
5151
setAddShareType("");
5252
} catch (error) {
5353
console.error(error);
54+
setDrawerHeading(`Seed Phrase`);
55+
setDrawerInfo(`Error Setting Seed phrase: ${(error as Error).message || "Failed"}`);
5456
} finally {
5557
setIsLoading(false);
5658
}

demo/redirect-flow-example/src/components/mfa-cards/password/CreatePassword.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ const GetPasswordCard: React.FC = () => {
6868
setDrawerInfo("Security question has been set successfully");
6969
} catch (error) {
7070
console.error(error);
71+
setDrawerHeading("Security Question");
72+
setDrawerInfo(`Error Setting Security Question: ${(error as Error).message || "Failed"}`);
7173
} finally {
7274
setIsLoading(false);
7375
}

demo/redirect-flow-example/src/components/mfa-cards/recovery/RecoveryOptionCard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import { Card } from "../../Card";
55
import { useCoreKit } from "../../../composibles/useCoreKit";
66
import { BN } from "bn.js";
77
import { COREKIT_STATUS } from "@web3auth/mpc-core-kit";
8+
import { KeyType } from "@tkey/common-types";
89

910
const RecoveryOptionsCard: React.FC = () => {
1011
const navigate = useNavigate();
11-
const { coreKitInstance, setCoreKitStatus, existingModules } = useCoreKit();
12+
const { coreKitInstance, setCoreKitStatus, existingModules, setKeyType } = useCoreKit();
1213

1314
const handleRecoveryOption = (option: string) => {
1415
navigate(`/verify-${option}`);
@@ -27,6 +28,7 @@ const RecoveryOptionsCard: React.FC = () => {
2728
input: { message: "KEY_NOT_FOUND" },
2829
});
2930
await coreKitInstance.logout();
31+
setKeyType(KeyType.secp256k1);
3032
setCoreKitStatus(COREKIT_STATUS.NOT_INITIALIZED)
3133
navigate("/");
3234
}

0 commit comments

Comments
 (0)