chore: fix strings

pull/3206/head
Ryan Miller 1 year ago
parent 8c0f6ea4e0
commit b8494b6948

@ -154,7 +154,7 @@ export const BanOrUnBanUserDialog = (props: {
buttonType={SessionButtonType.Simple} buttonType={SessionButtonType.Simple}
buttonColor={SessionButtonColor.Danger} buttonColor={SessionButtonColor.Danger}
onClick={startBanAndDeleteAllSequence} onClick={startBanAndDeleteAllSequence}
text={i18n('banUser')} text={i18n('banDeleteAll')}
disabled={inProgress} disabled={inProgress}
/> />
</> </>

@ -21,22 +21,22 @@ export const matchesHash = (phrase: string | null, hash: string) =>
export const validatePassword = (phrase: string) => { export const validatePassword = (phrase: string) => {
if (!isString(phrase)) { if (!isString(phrase)) {
return window?.i18n ? window?.i18n('passwordError') : ERRORS.TYPE; return window?.i18n ? window.i18n('passwordError') : ERRORS.TYPE;
} }
const trimmed = phrase.trim(); const trimmed = phrase.trim();
if (trimmed.length === 0) { if (trimmed.length === 0) {
return window?.i18n ? window?.i18n('passwordCreate') : ERRORS.LENGTH; return window?.i18n ? window.i18n('passwordCreate') : ERRORS.LENGTH;
} }
if (trimmed.length < 6 || trimmed.length > MAX_PASSWORD_LENGTH) { if (trimmed.length < 6 || trimmed.length > MAX_PASSWORD_LENGTH) {
return window?.i18n ? window?.i18n('passwordErrorLength') : ERRORS.LENGTH; return window?.i18n ? window.i18n('passwordErrorLength') : ERRORS.LENGTH;
} }
// Restrict characters to letters, numbers and symbols // Restrict characters to letters, numbers and symbols
const characterRegex = /^[a-zA-Z0-9-!?/\\()._`~@#$%^&*+=[\]{}|<>,;: ]+$/; const characterRegex = /^[a-zA-Z0-9-!?/\\()._`~@#$%^&*+=[\]{}|<>,;: ]+$/;
if (!characterRegex.test(trimmed)) { if (!characterRegex.test(trimmed)) {
return window?.i18n ? window?.i18n('passwordError') : ERRORS.CHARACTER; return window?.i18n ? window.i18n('passwordError') : ERRORS.CHARACTER;
} }
return null; return null;

Loading…
Cancel
Save