Skip to content
Merged
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
23 changes: 11 additions & 12 deletions src/editor/interaction-library/configure-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,19 @@ export const ConfigureModal = props => {

// Save through the editor if it's the last interaction
if ( index === array.length - 1 ) {
// Create the new interaction
window.dispatchEvent( new window.CustomEvent( 'interact/add-interaction', {
detail: {
type: interaction?.type ?? '',
target: interaction.target,
props: interaction,
},
} ) )
// Close the modal and open the interactions sidebar
// before dispatching the event to add the interaction.
closeModal()
openInteractionsSidebar()

setTimeout( () => {
window.dispatchEvent( new window.CustomEvent( 'interact/add-interaction', {
detail: {
type: interaction?.type ?? '',
target: interaction.target,
props: interaction,
},
} ) )
window?.dispatchEvent( new CustomEvent( 'interact/save-interaction' ) )
dispatch( 'core/editor' ).savePost()
}, 100 )
Expand All @@ -147,10 +150,6 @@ export const ConfigureModal = props => {
updateInteraction( newInteraction )
}
} )

// Close the modal, and open the sidebar for the new interaction.
closeModal()
openInteractionsSidebar()
}

// If skipConfig is true, just apply the interaction user without configuration.
Expand Down
Loading