From 34aa1f97b8e70f6761e124c424ed4f88ba41ac0a Mon Sep 17 00:00:00 2001 From: Khimendrapal Solanki <84378369+lapardnemihk1099@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:20:41 +0530 Subject: [PATCH] chore: fix add_shortcut conditions Co-authored-by: Shariq Ansari <30859809+shariquerik@users.noreply.github.com> --- frappe/public/js/frappe/desk.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frappe/public/js/frappe/desk.js b/frappe/public/js/frappe/desk.js index 4f80218c14..c1fc21fe76 100644 --- a/frappe/public/js/frappe/desk.js +++ b/frappe/public/js/frappe/desk.js @@ -59,12 +59,10 @@ frappe.Application = class Application { shortcut: 'shift+ctrl+g', description: __('Switch Theme'), action: () => { - if (cur_dialog) { + if (frappe.theme_switcher && frappe.theme_switcher.dialog.is_visible) { frappe.theme_switcher.hide(); } else { - if (!frappe.theme_switcher) { - frappe.theme_switcher = new frappe.ui.ThemeSwitcher(); - } + frappe.theme_switcher = new frappe.ui.ThemeSwitcher(); frappe.theme_switcher.show(); } }