fix: not able to go back from user profile page
credit: @ankush
This commit is contained in:
parent
dad4273997
commit
41bb12a206
1 changed files with 9 additions and 15 deletions
|
|
@ -17,21 +17,15 @@ class UserProfile {
|
|||
show() {
|
||||
let route = frappe.get_route();
|
||||
this.user_id = route[1] || frappe.session.user;
|
||||
|
||||
//validate if user
|
||||
if (route.length > 1) {
|
||||
frappe.dom.freeze(__('Loading user profile') + '...');
|
||||
frappe.db.exists('User', this.user_id).then(exists => {
|
||||
frappe.dom.unfreeze();
|
||||
if (exists) {
|
||||
this.make_user_profile();
|
||||
} else {
|
||||
frappe.msgprint(__('User does not exist'));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
frappe.set_route('user-profile', frappe.session.user);
|
||||
}
|
||||
frappe.dom.freeze(__('Loading user profile') + '...');
|
||||
frappe.db.exists('User', this.user_id).then(exists => {
|
||||
frappe.dom.unfreeze();
|
||||
if (exists) {
|
||||
this.make_user_profile();
|
||||
} else {
|
||||
frappe.msgprint(__('User does not exist'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
make_user_profile() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue