From fa930e7dbdf7ae556dc6192e0905f319745dce00 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Wed, 1 Dec 2021 13:47:47 +0100 Subject: [PATCH] KeybindingSrv: Prevent dashboard save modal when dashboard cannot be saved (#42505) --- public/app/core/services/keybindingSrv.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index d807975d1e1..8356343dd81 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -173,14 +173,16 @@ export class KeybindingSrv { }); this.bind('mod+s', () => { - appEvents.publish( - new ShowModalReactEvent({ - component: SaveDashboardModalProxy, - props: { - dashboard, - }, - }) - ); + if (dashboard.meta.canSave) { + appEvents.publish( + new ShowModalReactEvent({ + component: SaveDashboardModalProxy, + props: { + dashboard, + }, + }) + ); + } }); this.bind('t z', () => {