mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Save pay later messaging config to database
This commit is contained in:
parent
a652f21629
commit
66c6fb17b8
6 changed files with 70 additions and 37 deletions
|
@ -2,6 +2,7 @@ import { useCallback } from '@wordpress/element';
|
|||
|
||||
import {
|
||||
CommonHooks,
|
||||
PayLaterMessagingHooks,
|
||||
PaymentHooks,
|
||||
SettingsHooks,
|
||||
StylingHooks,
|
||||
|
@ -13,8 +14,13 @@ export const useSaveSettings = () => {
|
|||
const { persist: persistPayment } = PaymentHooks.useStore();
|
||||
const { persist: persistSettings } = SettingsHooks.useStore();
|
||||
const { persist: persistStyling } = StylingHooks.useStore();
|
||||
const { persist: persistPayLaterMessaging } =
|
||||
PayLaterMessagingHooks.useStore();
|
||||
|
||||
const persistAll = useCallback( () => {
|
||||
// Executes onSave on TabPayLaterMessaging component.
|
||||
document.getElementById( 'configurator-publishButton' )?.click();
|
||||
|
||||
withActivity(
|
||||
'persist-methods',
|
||||
'Save payment methods',
|
||||
|
@ -30,7 +36,18 @@ export const useSaveSettings = () => {
|
|||
'Save styling details',
|
||||
persistStyling
|
||||
);
|
||||
}, [ persistPayment, persistSettings, persistStyling, withActivity ] );
|
||||
withActivity(
|
||||
'persist-pay-later-messaging',
|
||||
'Save pay later messaging details',
|
||||
persistPayLaterMessaging
|
||||
);
|
||||
}, [
|
||||
persistPayment,
|
||||
persistSettings,
|
||||
persistStyling,
|
||||
persistPayLaterMessaging,
|
||||
withActivity,
|
||||
] );
|
||||
|
||||
return { persistAll };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue