mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-25 20:03:00 +00:00
check if FB is defined
This commit is contained in:
parent
7729c3ae0f
commit
d2dad4dd85
1 changed files with 33 additions and 31 deletions
|
|
@ -75,6 +75,7 @@ const Intro = ({ queryParams }) => {
|
|||
}
|
||||
);
|
||||
const loginWithFacebook = React.useCallback(() => {
|
||||
if (typeof FB !== 'undefined') {
|
||||
FB.login((response) => {
|
||||
if (response.status === 'connected') {
|
||||
fetch('https://www.strem.io/fb-login-with-token/' + encodeURIComponent(response.authResponse.accessToken), { timeout: 10 * 60 * 1000 })
|
||||
|
|
@ -108,6 +109,7 @@ const Intro = ({ queryParams }) => {
|
|||
dispatch({ type: 'error', error: 'Login failed at getting token from Facebook' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
const loginWithEmail = React.useCallback(() => {
|
||||
if (typeof state.email !== 'string' || state.email.length === 0 || !emailRef.current.validity.valid) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue