From 41bb12a2065a7065fa5fdb63f887f3fa64f95b42 Mon Sep 17 00:00:00 2001 From: phot0n Date: Sat, 11 Dec 2021 23:47:39 +0530 Subject: [PATCH] fix: not able to go back from user profile page credit: @ankush --- .../user_profile/user_profile_controller.js | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/frappe/desk/page/user_profile/user_profile_controller.js b/frappe/desk/page/user_profile/user_profile_controller.js index c1a89f316e..7cfebdd8b5 100644 --- a/frappe/desk/page/user_profile/user_profile_controller.js +++ b/frappe/desk/page/user_profile/user_profile_controller.js @@ -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() {