Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Forms: fix integrations modal flash.
10 changes: 8 additions & 2 deletions projects/packages/forms/src/dashboard/integrations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { useSelect, useDispatch } from '@wordpress/data';
import { useCallback } from '@wordpress/element';
import { useCallback, useEffect, useState } from '@wordpress/element';
import { useNavigate } from 'react-router';
/**
* Internal dependencies
Expand All @@ -19,6 +19,7 @@ const EMPTY_ARRAY: Integration[] = [];

const Integrations = () => {
const navigate = useNavigate();
const [ isOpen, setIsOpen ] = useState( false );
const { integrations } = useSelect( ( select: SelectIntegrations ) => {
const store = select( INTEGRATIONS_STORE );
return {
Expand All @@ -27,13 +28,18 @@ const Integrations = () => {
}, [] ) as { integrations: Integration[] };
const { refreshIntegrations } = useDispatch( INTEGRATIONS_STORE ) as IntegrationsDispatch;

useEffect( () => {
setIsOpen( true );
}, [] );

const handleClose = useCallback( () => {
setIsOpen( false );
navigate( '/responses' );
}, [ navigate ] );

return (
<IntegrationsModal
isOpen={ true }
isOpen={ isOpen }
onClose={ handleClose }
attributes={ undefined }
setAttributes={ undefined }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Forms: fix integrations modal flash.
Loading