From 3ce728510400b6c420b60b08ff19887358fb3ae1 Mon Sep 17 00:00:00 2001 From: Niklas Kiefer Date: Fri, 22 Sep 2023 13:55:01 +0200 Subject: [PATCH] chore(feel-popup): make eventBus really optional --- src/components/entries/FEEL/FeelPopup.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/entries/FEEL/FeelPopup.js b/src/components/entries/FEEL/FeelPopup.js index 631047ae..d539aa4f 100644 --- a/src/components/entries/FEEL/FeelPopup.js +++ b/src/components/entries/FEEL/FeelPopup.js @@ -25,7 +25,7 @@ export const FEEL_POPUP_HEIGHT = 250; export default function FEELPopupRoot(props) { const { element, - eventBus, + eventBus = { fire() {}, on() {}, off() {} }, popupContainer } = props; @@ -74,10 +74,6 @@ export default function FEELPopupRoot(props) { // allow close and open via events useEffect(() => { - if (!eventBus) { - return; - } - const handlePopupOpen = (context) => { const { entryId, @@ -97,10 +93,6 @@ export default function FEELPopupRoot(props) { eventBus.on('feelPopup._isOpen', handleIsOpen); return () => { - if (!eventBus) { - return; - } - eventBus.off('feelPopup._close', handleClose); eventBus.off('feelPopup._open', handleOpen); eventBus.off('feelPopup._isOpen', handleIsOpen);