From e6e59cbe07b9801c56bf640181f8d144c535707c Mon Sep 17 00:00:00 2001 From: Maharshi Patel <39730881+maharshivpatel@users.noreply.github.com> Date: Tue, 30 May 2023 12:16:27 +0530 Subject: [PATCH] fix(ux): re routes based on setup_complete (#21118) * fix(ux): re routes based on setup_complete If Setup Wizard is not complete re_route any route to setup_wizard and if it complete re_route setup-wizard to app * fix: only re_route if not on setup-wizard. * fix: remove hardcoded slide number --------- Co-authored-by: Sagar Sharma --- frappe/public/js/frappe/router.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index c03bfc9b95..def04cf37e 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -139,6 +139,12 @@ frappe.router = { if (!frappe.app) return; let sub_path = this.get_sub_path(); + if (frappe.boot.setup_complete) { + !frappe.re_route["setup-wizard"] && (frappe.re_route["setup-wizard"] = "app"); + } else if (!sub_path.startsWith("setup-wizard")) { + frappe.re_route["setup-wizard"] && delete frappe.re_route["setup-wizard"]; + frappe.set_route(["setup-wizard"]); + } if (this.re_route(sub_path)) return; this.current_sub_path = sub_path;