From 1bd33d854f5c0121e012e479f41826def26ce744 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 22 Nov 2020 17:27:54 +0800 Subject: [PATCH] add error message --- src/locales/en.js | 1 + src/locales/zh_Hans.js | 1 + src/views/mobile/ApplicationLock.vue | 2 ++ src/views/mobile/Unlock.vue | 2 ++ 4 files changed, 6 insertions(+) diff --git a/src/locales/en.js b/src/locales/en.js index 00874f22..d9fce072 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -423,6 +423,7 @@ export default { 'You have enabled Face ID/Touch ID successfully': 'You have enabled Face ID/Touch ID successfully', 'This device does not support Face ID/Touch ID': 'This device does not support Face ID/Touch ID', 'Failed to enable Face ID/Touch ID': 'Failed to enable Face ID/Touch ID', + 'User has canceled authentication': 'User has canceled authentication', 'User has canceled or this device does not support Face ID/Touch ID': 'User has canceled or this device does not support Face ID/Touch ID', 'Failed to authenticate by Face ID/Touch ID': 'Failed to authenticate by Face ID/Touch ID', 'Exchange Rates Data': 'Exchange Rates Data', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 87728b1e..6fdc6bed 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -423,6 +423,7 @@ export default { 'You have enabled Face ID/Touch ID successfully': '您已经成功开启面容ID / 指纹ID', 'This device does not support Face ID/Touch ID': '当前设备不支持 Face ID 或 Touch ID', 'Failed to enable Face ID/Touch ID': '启用 Face ID 或 Touch ID 失败', + 'User has canceled authentication': '用户已经取消认证', 'User has canceled or this device does not support Face ID/Touch ID': '用户已取消或当前设备不支持 Face ID 或 Touch ID', 'Failed to authenticate by Face ID/Touch ID': '使用 Face ID / Touch ID 认证失败', 'Exchange Rates Data': '汇率数据', diff --git a/src/views/mobile/ApplicationLock.vue b/src/views/mobile/ApplicationLock.vue index 1a2ba31a..da78563f 100644 --- a/src/views/mobile/ApplicationLock.vue +++ b/src/views/mobile/ApplicationLock.vue @@ -119,6 +119,8 @@ export default { if (error.notSupported) { self.$toast('This device does not support Face ID/Touch ID'); + } else if (error.name === 'NotAllowedError') { + self.$toast('User has canceled authentication'); } else if (error.invalid) { self.$toast('Failed to enable Face ID/Touch ID'); } else { diff --git a/src/views/mobile/Unlock.vue b/src/views/mobile/Unlock.vue index 33396663..ff64f34a 100644 --- a/src/views/mobile/Unlock.vue +++ b/src/views/mobile/Unlock.vue @@ -49,6 +49,8 @@ export default { if (error.notSupported) { self.$toast('This device does not support Face ID/Touch ID'); + } else if (error.name === 'NotAllowedError') { + self.$toast('User has canceled authentication'); } else if (error.invalid) { self.$toast('Failed to authenticate by Face ID/Touch ID'); } else {