Skip to content

Commit 75fad8c

Browse files
authored
Forms: fix integrations modal flash (#45775)
1 parent 920bbbd commit 75fad8c

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Forms: fix integrations modal flash.

projects/packages/forms/src/dashboard/integrations/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* External dependencies
33
*/
44
import { useSelect, useDispatch } from '@wordpress/data';
5-
import { useCallback } from '@wordpress/element';
5+
import { useCallback, useEffect, useState } from '@wordpress/element';
66
import { useNavigate } from 'react-router';
77
/**
88
* Internal dependencies
@@ -19,6 +19,7 @@ const EMPTY_ARRAY: Integration[] = [];
1919

2020
const Integrations = () => {
2121
const navigate = useNavigate();
22+
const [ isOpen, setIsOpen ] = useState( false );
2223
const { integrations } = useSelect( ( select: SelectIntegrations ) => {
2324
const store = select( INTEGRATIONS_STORE );
2425
return {
@@ -27,13 +28,18 @@ const Integrations = () => {
2728
}, [] ) as { integrations: Integration[] };
2829
const { refreshIntegrations } = useDispatch( INTEGRATIONS_STORE ) as IntegrationsDispatch;
2930

31+
useEffect( () => {
32+
setIsOpen( true );
33+
}, [] );
34+
3035
const handleClose = useCallback( () => {
36+
setIsOpen( false );
3137
navigate( '/responses' );
3238
}, [ navigate ] );
3339

3440
return (
3541
<IntegrationsModal
36-
isOpen={ true }
42+
isOpen={ isOpen }
3743
onClose={ handleClose }
3844
attributes={ undefined }
3945
setAttributes={ undefined }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: bugfix
3+
4+
Forms: fix integrations modal flash.

0 commit comments

Comments
 (0)