mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
💄 Lock app in “loading state” in last oauth stage
A redirect happens, and the current page should stay locked preventing users from interacting with the wizard before the refresh is finished.
This commit is contained in:
parent
696f8ec6e0
commit
92a0977ae8
1 changed files with 9 additions and 10 deletions
|
@ -30,7 +30,7 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
|
|||
const { sandboxOnboardingUrl } = CommonHooks.useSandbox();
|
||||
const { productionOnboardingUrl } = CommonHooks.useProduction();
|
||||
const products = OnboardingHooks.useDetermineProducts();
|
||||
const { withActivity } = CommonHooks.useBusyState();
|
||||
const { withActivity, startActivity } = CommonHooks.useBusyState();
|
||||
const { authenticateWithOAuth } = CommonHooks.useAuthentication();
|
||||
const [ onboardingUrl, setOnboardingUrl ] = useState( '' );
|
||||
const [ scriptLoaded, setScriptLoaded ] = useState( false );
|
||||
|
@ -110,16 +110,15 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
|
|||
* frame before the REST endpoint returns a value. Using "withActivity" is more of a
|
||||
* visual cue to the user that something is still processing in the background.
|
||||
*/
|
||||
await withActivity(
|
||||
startActivity(
|
||||
ACTIVITIES.OAUTH_VERIFY,
|
||||
'Validating the connection details',
|
||||
async () => {
|
||||
await authenticateWithOAuth(
|
||||
sharedId,
|
||||
authCode,
|
||||
'sandbox' === environment
|
||||
);
|
||||
}
|
||||
'Validating the connection details'
|
||||
);
|
||||
|
||||
await authenticateWithOAuth(
|
||||
sharedId,
|
||||
authCode,
|
||||
'sandbox' === environment
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue