From c57e8612388270857afc88441e5cd2b88e7bdd05 Mon Sep 17 00:00:00 2001 From: FTCHD <144691102+FTCHD@users.noreply.github.com> Date: Tue, 24 Mar 2026 00:14:24 +0200 Subject: [PATCH] Enter to submit, #171 --- src/pages/Settings/index.tsx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/pages/Settings/index.tsx b/src/pages/Settings/index.tsx index 2d34d4e..38d7b73 100644 --- a/src/pages/Settings/index.tsx +++ b/src/pages/Settings/index.tsx @@ -85,6 +85,17 @@ export default function Settings() { ) } + const checkPassword = async () => { + if (passwordCheckInput === settingsPass) { + setPasswordCheckPassed(true) + return + } + await message('The password you entered is incorrect.', { + title: 'Login failed', + kind: 'error', + }) + } + if (settingsPass && !passwordCheckPassed) { return (
@@ -92,6 +103,9 @@ export default function Settings() { placeholder="Enter pin or password" value={passwordCheckInput} onChange={(e) => setPasswordCheckInput(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') checkPassword() + }} autoCapitalize="none" autoComplete="off" autoCorrect="off" @@ -111,17 +125,7 @@ export default function Settings() { } />