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 );
|
setIsPending( true );
|
||||||
updateAndPersistSettingsForGroup( 'tax', {
|
try {
|
||||||
tax: {
|
await Promise.all( [
|
||||||
...taxSettings,
|
updateAndPersistSettingsForGroup( 'tax', {
|
||||||
wc_connect_taxes_enabled: 'yes',
|
tax: {
|
||||||
},
|
...taxSettings,
|
||||||
} );
|
wc_connect_taxes_enabled: 'yes',
|
||||||
updateAndPersistSettingsForGroup( 'general', {
|
},
|
||||||
general: {
|
} ),
|
||||||
...generalSettings,
|
updateAndPersistSettingsForGroup( 'general', {
|
||||||
woocommerce_calc_taxes: 'yes',
|
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(
|
createNotice(
|
||||||
'success',
|
'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