update prompt text

This commit is contained in:
MaysWind
2023-04-22 17:05:52 +08:00
parent 4038b6bc51
commit dab7728138
7 changed files with 39 additions and 35 deletions
+11 -7
View File
@@ -7,8 +7,12 @@
<f7-list strong inset dividers class="margin-top">
<f7-list-item :title="$t('Status')" :after="$t(isEnableApplicationLock ? 'Enabled' : 'Disabled')"></f7-list-item>
<f7-list-item v-if="isEnableApplicationLock">
<span>{{ $t('Unlock By PIN Code') }}</span>
<f7-toggle checked disabled></f7-toggle>
</f7-list-item>
<f7-list-item v-if="isEnableApplicationLock && isSupportedWebAuthn">
<span>{{ $t('Face ID / Touch ID') }}</span>
<span>{{ $t('Unlock By WebAuthn') }}</span>
<f7-toggle :checked="isEnableApplicationLockWebAuthn" @toggle:change="isEnableApplicationLockWebAuthn = $event"></f7-toggle>
</f7-list-item>
<f7-list-button v-if="isEnableApplicationLock" @click="disable(null)">{{ $t('Disable') }}</f7-list-button>
@@ -16,7 +20,7 @@
</f7-list>
<pin-code-input-sheet :title="$t('PIN Code')"
:hint="$t('Please input a new PIN code. PIN code would encrypt your local data, so you need input this PIN code when you launch this app. If this PIN code is lost, you should re-login.')"
:hint="$t('Please input a new 6-digit PIN code. PIN code would encrypt your local data, so you need input this PIN code when you launch this app. If this PIN code is lost, you should re-login.')"
v-model:show="showInputPinCodeSheetForEnable"
v-model="currentPinCodeForEnable"
@pincode:confirm="enable">
@@ -59,20 +63,20 @@ export default {
self.$user.saveWebAuthnConfig(id);
self.$settings.setEnableApplicationLockWebAuthn(true);
self.$toast('You have enabled Face ID/Touch ID successfully');
self.$toast('You have enabled WebAuthn successfully');
}).catch(error => {
self.$logger.error('failed to enable FaceID/Touch ID', error);
self.$logger.error('failed to enable WebAuthn', error);
self.$hideLoading();
if (error.notSupported) {
self.$toast('This device does not support Face ID/Touch ID');
self.$toast('This device does not support WebAuthn');
} else if (error.name === 'NotAllowedError') {
self.$toast('User has canceled authentication');
} else if (error.invalid) {
self.$toast('Failed to enable Face ID/Touch ID');
self.$toast('Failed to enable WebAuthn');
} else {
self.$toast('User has canceled or this device does not support Face ID/Touch ID');
self.$toast('User has canceled or this device does not support WebAuthn');
}
self.isEnableApplicationLockWebAuthn = false;
+6 -6
View File
@@ -18,7 +18,7 @@
<f7-list>
<f7-list-button :class="{ 'disabled': !isPinCodeValid(pinCode) }" :text="$t('Unlock By PIN Code')" @click="unlockByPin"></f7-list-button>
<f7-list-button v-if="isWebAuthnAvailable" :text="$t('Unlock By Face ID/Touch ID')" @click="unlockByWebAuthn"></f7-list-button>
<f7-list-button v-if="isWebAuthnAvailable" :text="$t('Unlock By WebAuthn')" @click="unlockByWebAuthn"></f7-list-button>
<f7-block-footer>
<f7-link :text="$t('Re-login')" @click="relogin"></f7-link>
</f7-block-footer>
@@ -95,12 +95,12 @@ export default {
const router = self.f7router;
if (!self.$settings.isEnableApplicationLockWebAuthn() || !self.$user.getWebAuthnCredentialId()) {
self.$toast('Face ID/Touch ID authentication is not enabled');
self.$toast('WebAuthn is not enabled');
return;
}
if (!self.$webauthn.isSupported()) {
self.$toast('This device does not support Face ID/Touch ID');
self.$toast('This device does not support WebAuthn');
return;
}
@@ -125,13 +125,13 @@ export default {
self.$logger.error('failed to use webauthn to verify', error);
if (error.notSupported) {
self.$toast('This device does not support Face ID/Touch ID');
self.$toast('This device does not support WebAuthn');
} 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');
self.$toast('Failed to authenticate by WebAuthn');
} else {
self.$toast('User has canceled or this device does not support Face ID/Touch ID');
self.$toast('User has canceled or this device does not support WebAuthn');
}
});
},
+1 -1
View File
@@ -132,7 +132,7 @@
<f7-list-item class="ebk-list-item-error-info" v-if="extendInputIsInvalid" :footer="$t(extendInputInvalidProblemMessage)"></f7-list-item>
</f7-list>
<password-input-sheet :title="$t('Current Password')"
<password-input-sheet :title="$t('Modify Password')"
:hint="$t('Please enter your current password when modifying your password')"
:confirm-disabled="saving"
:cancel-disabled="saving"