From 3a096b832d73c71ad61b5c5a581b9e7c89054a90 Mon Sep 17 00:00:00 2001 From: Philipp Stracker Date: Thu, 13 Feb 2025 16:32:18 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Trigger=20disconnect=20modal=20via?= =?UTF-8?q?=20URL=20hash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Settings/Components/Settings/Parts/DisconnectButton.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Parts/DisconnectButton.js b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Parts/DisconnectButton.js index 48fd6c226..6e17c428d 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Parts/DisconnectButton.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Parts/DisconnectButton.js @@ -3,10 +3,11 @@ import { Button, Modal, ToggleControl } from '@wordpress/components'; import { useCallback, useState } from '@wordpress/element'; import { CommonHooks } from '../../../../../../data'; +import { useToggleState } from '../../../../../../hooks/useToggleState'; import { HStack } from '../../../../../ReusableComponents/Stack'; const DisconnectButton = () => { - const [ isOpen, setIsOpen ] = useState( false ); + const { isOpen, setIsOpen } = useToggleState( 'disconnect-merchant' ); const [ resetFlag, setResetFlag ] = useState( false ); const { disconnectMerchant } = CommonHooks.useDisconnectMerchant();