diff --git a/src/components/common/PinCodeInput.vue b/src/components/common/PinCodeInput.vue index cd18043a..cb505b72 100644 --- a/src/components/common/PinCodeInput.vue +++ b/src/components/common/PinCodeInput.vue @@ -33,6 +33,7 @@ const props = defineProps<{ length: number; disabled?: boolean; autofocus?: boolean; + autoConfirm?: boolean; secure?: boolean; }>(); @@ -151,6 +152,14 @@ function onKeydown(index: number, event: KeyboardEvent): void { return; } + if (index <= 0 && (event.shiftKey && event.key === 'Tab')) { + return; + } + + if (index >= props.length - 1 && (!event.shiftKey && event.key === 'Tab')) { + return; + } + if (event.key === 'Enter' && finalPinCode.value.length === props.length) { emit('pincode:confirm', finalPinCode.value); event.preventDefault(); @@ -204,7 +213,7 @@ function onKeydown(index: number, event: KeyboardEvent): void { setInputType(index); setNextFocus(index); - if (finalPinCode.value.length === props.length) { + if (props.autoConfirm && finalPinCode.value.length === props.length) { emit('pincode:confirm', finalPinCode.value); } } diff --git a/src/components/mobile/PinCodeInputSheet.vue b/src/components/mobile/PinCodeInputSheet.vue index f2088ce3..b3fc2cec 100644 --- a/src/components/mobile/PinCodeInputSheet.vue +++ b/src/components/mobile/PinCodeInputSheet.vue @@ -10,7 +10,7 @@

{{ hint }}

- + diff --git a/src/views/desktop/app/settings/tabs/AppLockSettingTab.vue b/src/views/desktop/app/settings/tabs/AppLockSettingTab.vue index 26793bd4..aabe3e7c 100644 --- a/src/views/desktop/app/settings/tabs/AppLockSettingTab.vue +++ b/src/views/desktop/app/settings/tabs/AppLockSettingTab.vue @@ -33,7 +33,7 @@
- +
@@ -147,6 +147,13 @@ export default { }); }, methods: { + confirm() { + if (this.isEnableApplicationLock) { + this.disable(); + } else { + this.enable(); + } + }, enable() { if (this.settingsStore.appSettings.applicationLock) { this.$refs.snackbar.showMessage('Application lock has been enabled'); diff --git a/src/views/mobile/UnlockPage.vue b/src/views/mobile/UnlockPage.vue index 2e44cad7..199eb4cd 100644 --- a/src/views/mobile/UnlockPage.vue +++ b/src/views/mobile/UnlockPage.vue @@ -12,7 +12,7 @@ - +