Fix tax task showing as not completed after setting up tax (#36468)
* Wait for requests to finish before redirecting * Add changelog
This commit is contained in:
parent
c71573d7f9
commit
025c6aab17
|
@ -92,20 +92,34 @@ const Tax: React.FC< TaxProps > = ( { onComplete, query, task } ) => {
|
|||
}
|
||||
}, [] );
|
||||
|
||||
const onAutomate = useCallback( () => {
|
||||
const onAutomate = useCallback( async () => {
|
||||
setIsPending( true );
|
||||
try {
|
||||
await Promise.all( [
|
||||
updateAndPersistSettingsForGroup( 'tax', {
|
||||
tax: {
|
||||
...taxSettings,
|
||||
wc_connect_taxes_enabled: 'yes',
|
||||
},
|
||||
} );
|
||||
} ),
|
||||
updateAndPersistSettingsForGroup( 'general', {
|
||||
general: {
|
||||
...generalSettings,
|
||||
woocommerce_calc_taxes: 'yes',
|
||||
},
|
||||
} );
|
||||
} ),
|
||||
] );
|
||||
} catch ( error: unknown ) {
|
||||
setIsPending( false );
|
||||
createNotice(
|
||||
'error',
|
||||
__(
|
||||
'There was a problem setting up automated taxes. Please try again.',
|
||||
'woocommerce'
|
||||
)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
createNotice(
|
||||
'success',
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix tax task showing as not completed after setting up tax
|
Loading…
Reference in New Issue