diff --git a/src/routes/settings/Restore.tsx b/src/routes/settings/Restore.tsx index 371d5df..43c626c 100644 --- a/src/routes/settings/Restore.tsx +++ b/src/routes/settings/Restore.tsx @@ -41,8 +41,8 @@ const initialValues: SeedWordsForm = { }; function validateWord(word?: string): boolean { - // return word?.trim() === "bacon"; - return WORDS_EN.includes(word?.trim() ?? ""); + const trimmed = word?.trim(); + return trimmed ? WORDS_EN.has(trimmed) : false; } function SeedTextField(props: TextFieldProps) { diff --git a/src/utils/words.ts b/src/utils/words.ts index aedba3e..544ff59 100644 --- a/src/utils/words.ts +++ b/src/utils/words.ts @@ -1,4 +1,4 @@ -export const WORDS_EN = [ +export const WORDS_EN: Set = new Set([ "abandon", "ability", "able", @@ -2047,4 +2047,4 @@ export const WORDS_EN = [ "zero", "zone", "zoo" -]; +]);