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 <sagarsharma.s312@gmail.com>
This commit is contained in:
Maharshi Patel 2023-05-30 12:16:27 +05:30 committed by GitHub
parent 66eb377492
commit e6e59cbe07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;