From cd63b186087d9dda114bb654d8d0ff81e49446a3 Mon Sep 17 00:00:00 2001
From: Philipp Stracker
Date: Fri, 17 Jan 2025 19:22:01 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Minor=20code=20cleanup?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../js/Components/Screens/Settings/Components/Navigation.js | 4 ++--
modules/ppcp-settings/resources/js/data/styling/hooks.js | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Navigation.js b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Navigation.js
index b15f1beea..9023a1f9b 100644
--- a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Navigation.js
+++ b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Navigation.js
@@ -1,12 +1,12 @@
import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
-import TopNavigation from '../../../ReusableComponents/TopNavigation';
import { CommonHooks, StylingHooks } from '../../../../data';
+import TopNavigation from '../../../ReusableComponents/TopNavigation';
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper';
const SettingsNavigation = () => {
- const { withActivity, isBusy } = CommonHooks.useBusyState();
+ const { withActivity } = CommonHooks.useBusyState();
// Todo: Implement other stores here.
const { persist: persistStyling } = StylingHooks.useStore();
diff --git a/modules/ppcp-settings/resources/js/data/styling/hooks.js b/modules/ppcp-settings/resources/js/data/styling/hooks.js
index ffcde584f..8227d0124 100644
--- a/modules/ppcp-settings/resources/js/data/styling/hooks.js
+++ b/modules/ppcp-settings/resources/js/data/styling/hooks.js
@@ -41,8 +41,9 @@ const useHooks = () => {
console.error(
`Trying to access non-existent style property: ${ locationId }.${ prop }. Possibly wrong style name - review the reducer.`
);
+ return null;
}
- return persistentData[ locationId ]?.[ prop ];
+ return persistentData[ locationId ][ prop ];
},
[ persistentData ]
);