Skip to content

Commit df54f6b

Browse files
committed
Show Spinner if onboarding scripts not yet loaded
1 parent 6b7ee44 commit df54f6b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/ppcp-onboarding/resources/js/task-list/connection-button.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
import { __ } from '@wordpress/i18n';
55
import apiFetch from '@wordpress/api-fetch';
6+
import { Spinner } from '@wordpress/components';
67
import { useDispatch } from '@wordpress/data';
78
import { useEffect, useState } from '@wordpress/element';
89

@@ -78,8 +79,8 @@ export const ConnectionButton = ( { onError = () => {} } ) => {
7879
result.scriptURL,
7980
result.scriptData,
8081
() => {
81-
setConnectionUrl( result.signupLink );
8282
setIsPending( false );
83+
setConnectionUrl( result.signupLink );
8384
}
8485
);
8586
} )
@@ -96,6 +97,10 @@ export const ConnectionButton = ( { onError = () => {} } ) => {
9697
} );
9798
};
9899

100+
if ( isPending ) {
101+
return <Spinner />;
102+
}
103+
99104
return (
100105
<>
101106
<a

0 commit comments

Comments
 (0)