From 3e84b2ba2f2fde104b9f808b1647b854fa0649e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 22 Aug 2024 13:35:24 +0200 Subject: [PATCH] Dashboard: Fixes closing share modal (#92267) --- public/app/features/dashboard-scene/sharing/ShareModal.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard-scene/sharing/ShareModal.tsx b/public/app/features/dashboard-scene/sharing/ShareModal.tsx index 8a325d5d0b9c9..da4d8c75320ef 100644 --- a/public/app/features/dashboard-scene/sharing/ShareModal.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareModal.tsx @@ -88,7 +88,12 @@ export class ShareModal extends SceneObjectBase implements Moda } onDismiss = () => { - locationService.partial({ shareView: null }); + if (this.state.panelRef) { + const dashboard = getDashboardSceneFor(this); + dashboard.closeModal(); + } else { + locationService.partial({ shareView: null }); + } }; onChangeTab: ComponentProps['onChangeTab'] = (tab) => {