diff --git a/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx b/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx index bbb48cc6524..7b5b87a11cf 100644 --- a/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.tsx @@ -38,7 +38,9 @@ export class ShareDrawer extends SceneObjectBase implements Mo } onDismiss = () => { - if (this.state.panelRef) { + if (this.state.activeShare?.onDismiss) { + this.state.activeShare.onDismiss(); + } else if (this.state.panelRef) { const dashboard = getDashboardSceneFor(this); dashboard.closeModal(); } else { diff --git a/public/app/features/dashboard-scene/sharing/types.ts b/public/app/features/dashboard-scene/sharing/types.ts index d6c93a7eb2a..bf344638d86 100644 --- a/public/app/features/dashboard-scene/sharing/types.ts +++ b/public/app/features/dashboard-scene/sharing/types.ts @@ -15,4 +15,5 @@ export interface SceneShareTab void; }