From 55612b2aaf580b3509e835cbd672c832b78b94ce Mon Sep 17 00:00:00 2001 From: Alquen Sarmiento Date: Tue, 12 May 2026 10:09:20 +0800 Subject: [PATCH] fix: avoid rendering the design library modal again --- src/plugins/guided-modal-tour/editor-block-tour.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/guided-modal-tour/editor-block-tour.js b/src/plugins/guided-modal-tour/editor-block-tour.js index e21aed69a..317715251 100644 --- a/src/plugins/guided-modal-tour/editor-block-tour.js +++ b/src/plugins/guided-modal-tour/editor-block-tour.js @@ -3,6 +3,13 @@ import { registerPlugin } from '@wordpress/plugins' import { useEffect, useState } from '@wordpress/element' import { GuidedModalTour } from '~stackable/components' +// These tours render inside their own modal. +// Rendering the tours here creates duplicate tour modals and +// can close the owning modal unexpectedly. +const MODAL_OWNED_TOURS = [ + 'design-library', +] + const EditorBlockTour = () => { const [ tourId, setTourId ] = useState( 'blocks' ) useEffect( () => { @@ -16,7 +23,7 @@ const EditorBlockTour = () => { }, [] ) // Do not load if there is no tourId. - if ( ! tourId ) { + if ( ! tourId || MODAL_OWNED_TOURS.includes( tourId ) ) { return null }