fix: after creating workspace and reloading it gives error
also if workspace does not exist it gives proper error and redirect to last opened workspaces
This commit is contained in:
parent
a227944cfc
commit
e4c45dd719
2 changed files with 12 additions and 1 deletions
|
|
@ -177,8 +177,18 @@ frappe.router = {
|
|||
if (frappe.workspaces[route[0]]) {
|
||||
// public workspace
|
||||
route = ["Workspaces", frappe.workspaces[route[0]].title];
|
||||
} else if (route[0] == "private" && frappe.workspaces[private_workspace]) {
|
||||
} else if (route[0] == "private") {
|
||||
// private workspace
|
||||
if (!frappe.workspaces[private_workspace] && localStorage.new_workspace) {
|
||||
let new_workspace = JSON.parse(localStorage.new_workspace);
|
||||
if (frappe.router.slug(new_workspace.title) === route[1]) {
|
||||
frappe.workspaces[private_workspace] = new_workspace;
|
||||
}
|
||||
}
|
||||
if (!frappe.workspaces[private_workspace]) {
|
||||
frappe.msgprint(__("Workspace <b>{0}</b> does not exist", [route[1]]));
|
||||
return ["Workspaces"];
|
||||
}
|
||||
route = ["Workspaces", "private", frappe.workspaces[private_workspace].title];
|
||||
} else if (this.routes[route[0]]) {
|
||||
// route
|
||||
|
|
|
|||
|
|
@ -1210,6 +1210,7 @@ frappe.views.Workspace = class Workspace {
|
|||
|
||||
this.make_sidebar();
|
||||
this.show_sidebar_actions();
|
||||
localStorage.setItem("new_workspace", JSON.stringify(new_page));
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue