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() {