mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
♻️ Fix new implementation of controls
This commit is contained in:
parent
90c6cd1e7d
commit
a7b854abb5
1 changed files with 19 additions and 6 deletions
|
@ -186,10 +186,12 @@ export const setProducts = ( products ) => {
|
||||||
*
|
*
|
||||||
* @return {Action} The action.
|
* @return {Action} The action.
|
||||||
*/
|
*/
|
||||||
export const persist = () => {
|
export const persist = function* () {
|
||||||
return {
|
const data = yield select( STORE_NAME ).persistentData();
|
||||||
type: ACTION_TYPES.DO_PERSIST_DATA,
|
|
||||||
};
|
yield setIsSaving( true );
|
||||||
|
yield { type: ACTION_TYPES.DO_PERSIST_DATA, data };
|
||||||
|
yield setIsSaving( false );
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -197,8 +199,19 @@ export const persist = () => {
|
||||||
*
|
*
|
||||||
* @return {Action} The action.
|
* @return {Action} The action.
|
||||||
*/
|
*/
|
||||||
export const connectViaIdAndSecret = () => {
|
export const connectViaIdAndSecret = function* () {
|
||||||
return {
|
const { clientId, clientSecret, useSandbox } =
|
||||||
|
yield select( STORE_NAME ).persistentData();
|
||||||
|
|
||||||
|
yield setManualConnectionIsBusy( true );
|
||||||
|
|
||||||
|
const result = yield {
|
||||||
type: ACTION_TYPES.DO_MANUAL_CONNECTION,
|
type: ACTION_TYPES.DO_MANUAL_CONNECTION,
|
||||||
|
clientId,
|
||||||
|
clientSecret,
|
||||||
|
useSandbox,
|
||||||
};
|
};
|
||||||
|
yield setManualConnectionIsBusy( false );
|
||||||
|
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue