diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/ResubscribeBlock.js b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/ResubscribeBlock.js index 83b54069a..2e0e7ab11 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/ResubscribeBlock.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/ResubscribeBlock.js @@ -19,20 +19,22 @@ const ResubscribeBlock = () => { } catch ( error ) { setResubscribing( false ); createErrorNotice( - __( - 'Operation failed. Check WooCommerce logs for more details.', - 'woocommerce-paypal-payments' - ) + '❌ ' + + __( + 'Operation failed. Check WooCommerce logs for more details.', + 'woocommerce-paypal-payments' + ) ); return; } setResubscribing( false ); createSuccessNotice( - __( - 'Webhooks were successfully re-subscribed.', - 'woocommerce-paypal-payments' - ) + '✔️ ' + + __( + 'Webhooks were successfully re-subscribed.', + 'woocommerce-paypal-payments' + ) ); }; diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/SimulationBlock.js b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/SimulationBlock.js index 3233c2409..1737d8248 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/SimulationBlock.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/SimulationBlock.js @@ -7,7 +7,7 @@ import { useDispatch } from '@wordpress/data'; import { store as noticesStore } from '@wordpress/notices'; const SimulationBlock = () => { - const { createSuccessNotice, createErrorNotice } = + const { createSuccessNotice, createInfoNotice, createErrorNotice } = useDispatch( noticesStore ); const [ simulating, setSimulating ] = useState( false ); @@ -29,13 +29,10 @@ const SimulationBlock = () => { } ); }, [] ); - const startSimulation = async () => { - const retriesBeforeErrorMessage = 15; - const maxRetries = 30; - + const startSimulation = async ( retriesBeforeErrorMessage, maxRetries ) => { setSimulating( true ); - createSuccessNotice( + createInfoNotice( __( 'Waiting for the webhook to arrive…', 'woocommerce-paypal-payments' @@ -48,7 +45,8 @@ const SimulationBlock = () => { setSimulating( false ); createErrorNotice( __( - 'Operation failed. Check WooCommerce logs for more details.', + '❌ ' + + 'Operation failed. Check WooCommerce logs for more details.', 'woocommerce-paypal-payments' ) ); @@ -87,7 +85,8 @@ const SimulationBlock = () => { if ( i === retriesBeforeErrorMessage ) { createErrorNotice( __( - 'Looks like the webhook cannot be received. Check that your website is accessible from the internet.', + '❌ ' + + 'Looks like the webhook cannot be received. Check that your website is accessible from the internet.', 'woocommerce-paypal-payments' ) ); @@ -107,7 +106,7 @@ const SimulationBlock = () => { actionProps={ { buttonType: 'secondary', isBusy: simulating, - callback: () => startSimulation(), + callback: () => startSimulation( 15, 30 ), value: __( 'Simulate webhooks', 'woocommerce-paypal-payments' diff --git a/modules/ppcp-settings/resources/js/data/common/reducer.js b/modules/ppcp-settings/resources/js/data/common/reducer.js index e5ab83871..350d9c308 100644 --- a/modules/ppcp-settings/resources/js/data/common/reducer.js +++ b/modules/ppcp-settings/resources/js/data/common/reducer.js @@ -87,9 +87,9 @@ const commonReducer = createReducer( defaultTransient, defaultPersistent, { [ ACTION_TYPES.HYDRATE ]: ( state, payload ) => { const newState = setPersistent( state, payload.data ); - console.log( state, payload ); + // Populate read-only properties. - [ 'wooSettings', 'merchant', 'webhooks' ].forEach( ( key ) => { + [ 'wooSettings', 'merchant' ].forEach( ( key ) => { if ( ! payload[ key ] ) { return; }