mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
Update Intro.js added translatable error messages
This commit is contained in:
parent
3f685173c1
commit
83bb34e505
1 changed files with 7 additions and 7 deletions
|
|
@ -138,11 +138,11 @@ const Intro = ({ queryParams }) => {
|
||||||
}, []);
|
}, []);
|
||||||
const loginWithEmail = React.useCallback(() => {
|
const loginWithEmail = React.useCallback(() => {
|
||||||
if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) {
|
if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) {
|
||||||
dispatch({ type: 'error', error: 'Invalid email' });
|
dispatch({ type: 'error', error: t('INVALID_EMAIL') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof state.password !== 'string' || state.password.length === 0) {
|
if (typeof state.password !== 'string' || state.password.length === 0) {
|
||||||
dispatch({ type: 'error', error: 'Invalid password' });
|
dispatch({ type: 'error', error: t('INVALID_PASSWORD') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
openLoaderModal();
|
openLoaderModal();
|
||||||
|
|
@ -160,26 +160,26 @@ const Intro = ({ queryParams }) => {
|
||||||
}, [state.email, state.password]);
|
}, [state.email, state.password]);
|
||||||
const loginAsGuest = React.useCallback(() => {
|
const loginAsGuest = React.useCallback(() => {
|
||||||
if (!state.termsAccepted) {
|
if (!state.termsAccepted) {
|
||||||
dispatch({ type: 'error', error: 'You must accept the Terms of Service' });
|
dispatch({ type: 'error', error: t('MUST_ACCEPT_TERMS') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.location = '#/';
|
window.location = '#/';
|
||||||
}, [state.termsAccepted]);
|
}, [state.termsAccepted]);
|
||||||
const signup = React.useCallback(() => {
|
const signup = React.useCallback(() => {
|
||||||
if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) {
|
if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) {
|
||||||
dispatch({ type: 'error', error: 'Invalid email' });
|
dispatch({ type: 'error', error: t('INVALID_EMAIL') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof state.password !== 'string' || state.password.length === 0) {
|
if (typeof state.password !== 'string' || state.password.length === 0) {
|
||||||
dispatch({ type: 'error', error: 'Invalid password' });
|
dispatch({ type: 'error', error: t('INVALID_PASSWORD') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (state.password !== state.confirmPassword) {
|
if (state.password !== state.confirmPassword) {
|
||||||
dispatch({ type: 'error', error: 'Passwords do not match' });
|
dispatch({ type: 'error', error: t('PASSWORDS_NOMATCH') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!state.termsAccepted) {
|
if (!state.termsAccepted) {
|
||||||
dispatch({ type: 'error', error: 'You must accept the Terms of Service' });
|
dispatch({ type: 'error', error: t('MUST_ACCEPT_TERMS') });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!state.privacyPolicyAccepted) {
|
if (!state.privacyPolicyAccepted) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue