From f0a09ba83bfc8663b3bb629aebff7b6ee0911b55 Mon Sep 17 00:00:00 2001 From: inpsyde-maticluznar Date: Fri, 20 Dec 2024 12:38:42 +0100 Subject: [PATCH] Small code fixes --- .../Blocks/Troubleshooting/HooksTableBlock.js | 5 ++++- .../Blocks/Troubleshooting/Troubleshooting.js | 5 +---- modules/ppcp-settings/resources/js/data/common/reducer.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/HooksTableBlock.js b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/HooksTableBlock.js index 990d2ab8c..c86309ddd 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/HooksTableBlock.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/HooksTableBlock.js @@ -1,6 +1,9 @@ import { __ } from '@wordpress/i18n'; +import { CommonHooks } from '../../../../../../data'; + +const HooksTableBlock = () => { + const { webhooks } = CommonHooks.useWebhooks(); -const HooksTableBlock = ( { webhooks } ) => { return ( diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/Troubleshooting.js b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/Troubleshooting.js index e1f2eacc8..546659b1f 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/Troubleshooting.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Overview/TabSettingsElements/Blocks/Troubleshooting/Troubleshooting.js @@ -7,15 +7,12 @@ import { ToggleSettingsBlock, } from '../../../../../ReusableComponents/SettingsBlocks'; import SettingsBlock from '../../../../../ReusableComponents/SettingsBlocks/SettingsBlock'; -import { CommonHooks } from '../../../../../../data'; import SimulationBlock from './SimulationBlock'; import ResubscribeBlock from './ResubscribeBlock'; import HooksTableBlock from './HooksTableBlock'; const Troubleshooting = ( { updateFormValue, settings } ) => { - const { webhooks } = CommonHooks.useWebhooks(); - return ( { . - + diff --git a/modules/ppcp-settings/resources/js/data/common/reducer.js b/modules/ppcp-settings/resources/js/data/common/reducer.js index 350d9c308..8b5cfb9b3 100644 --- a/modules/ppcp-settings/resources/js/data/common/reducer.js +++ b/modules/ppcp-settings/resources/js/data/common/reducer.js @@ -35,7 +35,7 @@ const defaultPersistent = Object.freeze( { useManualConnection: false, clientId: '', clientSecret: '', - webhooks: 0, + webhooks: [], } ); // Reducer logic.