fix: update setup_complete based on current app

This commit is contained in:
Saqib Ansari 2025-06-13 14:41:17 +05:30 committed by GitHub
parent f8a6cf8995
commit b4686d83e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View file

@ -280,6 +280,14 @@ frappe.Application = class Application {
if (frappe.boot.print_css) {
frappe.dom.set_style(frappe.boot.print_css, "print-style");
}
let current_app = localStorage.current_app;
if (current_app) {
frappe.boot.setup_complete =
frappe.boot.setup_wizard_not_required_apps?.includes(current_app) ||
frappe.boot.setup_wizard_completed_apps?.includes(current_app);
}
frappe.user.name = frappe.boot.user.name;
frappe.router.setup();
} else {

View file

@ -128,13 +128,8 @@ frappe.router = {
if (!frappe.app) return;
let sub_path = this.get_sub_path();
let current_app = localStorage.current_app;
if (
frappe.boot.setup_complete ||
(current_app && frappe.boot.setup_wizard_not_required_apps?.includes(current_app)) ||
(current_app && frappe.boot.setup_wizard_completed_apps?.includes(current_app))
) {
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"];