fix: back navigation on user-profile (#11627)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
parent
f7b264afaf
commit
a3cdb8413e
2 changed files with 9 additions and 2 deletions
|
|
@ -42,7 +42,7 @@ class UserProfile {
|
|||
}
|
||||
|
||||
make_user_profile() {
|
||||
frappe.set_route('user-profile', this.user_id);
|
||||
frappe.set_route('user-profile', this.user_id, { redirect: true });
|
||||
this.user = frappe.user_info(this.user_id);
|
||||
this.page.set_title(this.user.fullname);
|
||||
this.setup_user_search();
|
||||
|
|
|
|||
|
|
@ -168,7 +168,14 @@ frappe.set_route = function() {
|
|||
}
|
||||
}).join('/');
|
||||
|
||||
window.location.hash = route;
|
||||
// Perform a redirect when redirect is set in route_options
|
||||
if (frappe.route_options && frappe.route_options.redirect) {
|
||||
const url = new URL(window.location);
|
||||
url.hash = route;
|
||||
window.location.replace(url);
|
||||
} else {
|
||||
window.location.hash = route;
|
||||
}
|
||||
|
||||
// Set favicon (app.js)
|
||||
frappe.provide('frappe.app');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue