fix: back navigation on user-profile (#11627)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
Akash Hamirwasia 2020-10-16 11:32:02 +05:30 committed by GitHub
parent f7b264afaf
commit a3cdb8413e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

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

View file

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