From 2fc666347372d679e00106410062f9f25eb2c0f2 Mon Sep 17 00:00:00 2001 From: prssanna Date: Fri, 1 May 2020 14:22:23 +0530 Subject: [PATCH] fix: confirm before resetting customizations --- .../js/frappe/views/dashboard/dashboard_view.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frappe/public/js/frappe/views/dashboard/dashboard_view.js b/frappe/public/js/frappe/views/dashboard/dashboard_view.js index b491cebf02..13c44d2130 100644 --- a/frappe/public/js/frappe/views/dashboard/dashboard_view.js +++ b/frappe/public/js/frappe/views/dashboard/dashboard_view.js @@ -228,12 +228,14 @@ frappe.views.DashboardView = class DashboardView extends frappe.views.ListView { } reset_dashboard_customization() { - this.dashboard_settings = null; - frappe.model.user_settings.save( - this.doctype, 'dashboard_settings', this.dashboard_settings - ).then(() => this.make_dashboard()); + frappe.confirm(__("Are you sure you want to reset all customizations?"), () => { + this.dashboard_settings = null; + frappe.model.user_settings.save( + this.doctype, 'dashboard_settings', this.dashboard_settings + ).then(() => this.make_dashboard()); - this.toggle_customize(false); + this.toggle_customize(false); + }); } toggle_customize(show) {