From b8fdcdaa20744c3be09535a30e64b38abbddc2c1 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Fri, 18 Dec 2020 18:19:23 +0530 Subject: [PATCH] fix: User profle page load --- frappe/desk/page/user_profile/user_profile.js | 6 ------ frappe/desk/page/user_profile/user_profile_controller.js | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frappe/desk/page/user_profile/user_profile.js b/frappe/desk/page/user_profile/user_profile.js index 2124bcf820..3443a33942 100644 --- a/frappe/desk/page/user_profile/user_profile.js +++ b/frappe/desk/page/user_profile/user_profile.js @@ -1,12 +1,6 @@ frappe.pages['user-profile'].on_page_load = function (wrapper) { - frappe.ui.make_app_page({ - parent: wrapper, - }); frappe.require('assets/js/user_profile_controller.min.js', () => { let user_profile = new frappe.ui.UserProfile(wrapper); user_profile.show(); - $(wrapper).bind('show', () => { - user_profile.show(); - }); }); }; \ No newline at end of file diff --git a/frappe/desk/page/user_profile/user_profile_controller.js b/frappe/desk/page/user_profile/user_profile_controller.js index 70f342bab3..03baa2b5a9 100644 --- a/frappe/desk/page/user_profile/user_profile_controller.js +++ b/frappe/desk/page/user_profile/user_profile_controller.js @@ -4,9 +4,14 @@ frappe.provide('frappe.energy_points'); class UserProfile { constructor(wrapper) { this.wrapper = $(wrapper); - this.page = wrapper.page; + this.page = frappe.ui.make_app_page({ + parent: wrapper, + }); this.sidebar = this.wrapper.find('.layout-side-section'); this.main_section = this.wrapper.find('.layout-main-section'); + this.wrapper.bind('show', () => { + this.show(); + }); } show() {