mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Merge pull request #3078 from woocommerce/PCP-4138-confirmation-message-after-saving-settings
Confirmation message after saving settings (4138)
This commit is contained in:
commit
b1adebdfe6
13 changed files with 239 additions and 101 deletions
|
@ -63,10 +63,10 @@ export const setPersistent = ( prop, value ) => ( {
|
|||
/**
|
||||
* Transient. Changes the "ready-state" of the module.
|
||||
*
|
||||
* @param {boolean} state Whether the store is ready to be used.
|
||||
* @param {boolean} isReady Whether the store is ready to be used.
|
||||
* @return {Action} The action.
|
||||
*/
|
||||
export const setIsReady = ( state ) => setTransient( 'isReady', state );
|
||||
export const setIsReady = ( isReady ) => setTransient( 'isReady', isReady );
|
||||
|
||||
/**
|
||||
* Thunk action creator. Triggers the persistence of store data to the server.
|
||||
|
@ -75,16 +75,10 @@ export const setIsReady = ( state ) => setTransient( 'isReady', state );
|
|||
*/
|
||||
export function persist() {
|
||||
return async ( { select } ) => {
|
||||
const data = select.persistentData();
|
||||
|
||||
try {
|
||||
await apiFetch( {
|
||||
path: REST_PERSIST_PATH,
|
||||
method: 'POST',
|
||||
data,
|
||||
} );
|
||||
} catch ( e ) {
|
||||
console.error( 'Error saving progress.', e );
|
||||
}
|
||||
await apiFetch( {
|
||||
path: REST_PERSIST_PATH,
|
||||
method: 'POST',
|
||||
data: select.persistentData(),
|
||||
} );
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue