diff --git a/bootstrap.php b/bootstrap.php index 243f273..94db10b 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -29,7 +29,7 @@ function () { define('MONTH_IN_SECONDS', '60 * 60 * 24 * 30'); } if ( ! defined( 'NFD_FACEBOOK_VERSION' ) ) { - define( 'NFD_FACEBOOK_VERSION', '1.0.4' ); + define( 'NFD_FACEBOOK_VERSION', '1.0.5' ); } new Facebook($container); }, diff --git a/build/index.asset.php b/build/index.asset.php index 03f5a87..74e5ecd 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-components', 'wp-i18n'), 'version' => 'eaa6051bcd3504c5558e'); + array('react', 'wp-api-fetch', 'wp-components', 'wp-i18n'), 'version' => '8ff8f172454392d65453'); diff --git a/package-lock.json b/package-lock.json index 373f48f..30f55dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@newfold-labs/wp-module-facebook", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@newfold-labs/wp-module-facebook", - "version": "1.0.4", + "version": "1.0.5", "license": "GPL-2.0-or-later", "dependencies": { "@newfold-labs/wp-module-runtime": "^1.0.0", diff --git a/package.json b/package.json index 37f2c38..88e9e97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@newfold-labs/wp-module-facebook", - "version": "1.0.4", + "version": "1.0.5", "description": "## How it works?", "main": "build/index.js", "scripts": { diff --git a/src/components/facebookConnectButton.js b/src/components/facebookConnectButton.js index 06c5323..48aec7e 100644 --- a/src/components/facebookConnectButton.js +++ b/src/components/facebookConnectButton.js @@ -64,11 +64,11 @@ const FacebookConnectButton = ({ onConnect(response); } } else { - if (counter < 2) { + if (counter < 8) { setTimeout(() => { - getProfileData(); + getProfileData(counter); setLoader(true); - }, 6000); + }, 2000); } else { setLoader(false); } @@ -82,10 +82,11 @@ const FacebookConnectButton = ({ apiFetch({ url: constants.wordpress.access }).then((res) => { res.token && setFieldValue(res.token); }); - getProfileData(1); + getProfileData(7); }, []); const connectFacebook = () => { + setLoader(true); const win = window.open( `${constants.cf_worker.login_screen}?token_hiive=${fieldValue}&redirect=${window.location.href}`, 'ModalPopUp', @@ -95,13 +96,13 @@ const FacebookConnectButton = ({ const intervalId = setInterval(() => { if (win?.closed) { - setLoader(true); + // setLoader(true); clearInterval(intervalId); setTimeout(() => { getProfileData(0); - }, 5000); + }, 2000); } - }, 5000) + }, 2000) if (typeof onClick === 'function') { onClick();