From 70e7f2adb5e31104fe7c0940653c00f6f622b71e Mon Sep 17 00:00:00 2001 From: hieu-w Date: Fri, 26 Jul 2024 16:06:04 +0700 Subject: [PATCH] Fix validation --- examples/vue-example/src/App.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/vue-example/src/App.vue b/examples/vue-example/src/App.vue index 7c713acd..386d8cbb 100644 --- a/examples/vue-example/src/App.vue +++ b/examples/vue-example/src/App.vue @@ -32,6 +32,7 @@ size="md" pill @click="getUserInfo" + data-testid="btnGetUserInfo" > Get user info @@ -44,6 +45,7 @@ size="md" pill @click="getOpenloginState" + data-testid="btnGetOpenloginState" > Get openlogin state @@ -56,6 +58,7 @@ size="md" pill @click="getEd25519Key" + data-testid="btnGetEd25519Key" > Get Ed25519Key @@ -69,6 +72,7 @@ size="md" pill @click="manageMFA" + data-testid="btnManageMFA" > Manage MFA @@ -80,6 +84,7 @@ size="md" pill @click="enableMFA" + data-testid="btnEnableMFA" > Enable MFA @@ -96,6 +101,7 @@ pill :disabled="!ethereumPrivateKeyProvider?.provider" @click="signMessage" + data-testid="btnSignMessage" > Sign test Eth Message @@ -109,6 +115,7 @@ pill :disabled="!ethereumPrivateKeyProvider?.provider" @click="signMpcMessage" + data-testid="btnSignMpcMessage" > Sign test Eth Message (MPC) @@ -122,6 +129,7 @@ pill :disabled="!ethereumPrivateKeyProvider?.provider" @click="latestBlock" + data-testid="btnLatestBlock" > Fetch latest block @@ -135,6 +143,7 @@ pill :disabled="!ethereumPrivateKeyProvider?.provider" @click="addChain" + data-testid="btnAddChain" > Add Sepolia @@ -148,6 +157,7 @@ pill :disabled="!ethereumPrivateKeyProvider?.provider" @click="switchChain" + data-testid="btnSwitchChain" > Switch to Sepolia @@ -161,6 +171,7 @@ pill :disabled="!ethereumPrivateKeyProvider?.provider" @click="signV1Message" + data-testid="btnSignV1Message" > Sign Typed data v1 test msg @@ -178,6 +189,7 @@ size="md" pill @click="clearConsole" + data-testid="btnClearConsole" > Clear console @@ -626,7 +638,7 @@ const isValidForm = computed(() => { }) const isValidMFASelection = computed(() => { - if (!selectedMandatoryMFAFactors.value.length) return true; + if (selectedMFAFactors.value?.length && !selectedMandatoryMFAFactors.value.length) return false; if (selectedMandatoryMFAFactors.value.every((x) => x === MFA_FACTOR.DEVICE)) return false; return true; });