Skip to content

Commit

Permalink
only invoke onUnLoad if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
imanjra committed Jan 9, 2025
1 parent c5d3bf5 commit 60971f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/packages/operators/src/CustomPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export function CustomPanel(props: CustomPanelProps) {
setPanelCloseEffect(() => {
clearUseKeyStores(panelId);
trackEvent("close_panel", { panel: panelName });
triggerPanelEvent(panelId, { operator: props.onUnLoad });
if (props.onUnLoad) {
triggerPanelEvent(panelId, { operator: props.onUnLoad });
}
});
}, []);

Expand Down

0 comments on commit 60971f8

Please sign in to comment.