mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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.
|
||||
*/
|
||||
export const persist = () => {
|
||||
return {
|
||||
type: ACTION_TYPES.DO_PERSIST_DATA,
|
||||
};
|
||||
export const persist = function* () {
|
||||
const data = yield select( STORE_NAME ).persistentData();
|
||||
|
||||
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.
|
||||
*/
|
||||
export const connectViaIdAndSecret = () => {
|
||||
return {
|
||||
export const connectViaIdAndSecret = function* () {
|
||||
const { clientId, clientSecret, useSandbox } =
|
||||
yield select( STORE_NAME ).persistentData();
|
||||
|
||||
yield setManualConnectionIsBusy( true );
|
||||
|
||||
const result = yield {
|
||||
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