We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7cc90e commit 5621f4fCopy full SHA for 5621f4f
assets/src/dashboard/parts/connecting/index.js
@@ -24,15 +24,21 @@ const ConnectingLayout = () => {
24
const [ progress, setProgress ] = useState( 0 );
25
const [ step, setStep ] = useState( 0 );
26
const [ timer, setTimer ] = useState( 0 );
27
- const maxTime = 25;
+ const maxTime = 5;
28
29
const { sethasDashboardLoaded } = useDispatch( 'optimole' );
30
31
useEffect( () => {
32
if ( timer <= maxTime ) {
33
- setTimeout( () => {
+ const timeout = setTimeout( () => {
34
updateProgress();
35
}, 1000 );
36
+
37
+ return () => {
38
+ if ( timeout ) {
39
+ clearTimeout( timeout );
40
+ }
41
+ };
42
}
43
}, [ timer ]);
44
0 commit comments