fix: Dont throw back to / if desk page not found (#19494)
This commit is contained in:
parent
deaaa789cf
commit
010aa4636a
2 changed files with 5 additions and 12 deletions
|
|
@ -168,7 +168,6 @@ frappe.Application = class Application {
|
|||
}
|
||||
|
||||
set_route() {
|
||||
frappe.flags.setting_original_route = true;
|
||||
if (frappe.boot && localStorage.getItem("session_last_route")) {
|
||||
frappe.set_route(localStorage.getItem("session_last_route"));
|
||||
localStorage.removeItem("session_last_route");
|
||||
|
|
@ -176,7 +175,6 @@ frappe.Application = class Application {
|
|||
// route to home page
|
||||
frappe.router.route();
|
||||
}
|
||||
frappe.after_ajax(() => (frappe.flags.setting_original_route = false));
|
||||
frappe.router.on("change", () => {
|
||||
$(".tooltip").hide();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -135,16 +135,11 @@ frappe.request.call = function (opts) {
|
|||
}
|
||||
},
|
||||
404: function (xhr) {
|
||||
if (frappe.flags.setting_original_route) {
|
||||
// original route is wrong, redirect to login
|
||||
frappe.app.redirect_to_login();
|
||||
} else {
|
||||
frappe.msgprint({
|
||||
title: __("Not found"),
|
||||
indicator: "red",
|
||||
message: __("The resource you are looking for is not available"),
|
||||
});
|
||||
}
|
||||
frappe.msgprint({
|
||||
title: __("Not found"),
|
||||
indicator: "red",
|
||||
message: __("The resource you are looking for is not available"),
|
||||
});
|
||||
},
|
||||
403: function (xhr) {
|
||||
if (frappe.session.user === "Guest" && frappe.session.logged_in_user !== "Guest") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue