From 7c1d047199af2dd6840dd1de7961c1dfb1acd372 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 27 Sep 2024 13:42:23 -0400 Subject: [PATCH] perf(admin): unload admin panel when leaving it to preserve performance Iterates #16043 By unloading the admin panel when leaving it, we can free the memory and also make sure that further updates to the community don't try to update the invisible models from the admins panels, some of which are very heavy. --- ui/app/AppLayouts/Chat/ChatLayout.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatLayout.qml b/ui/app/AppLayouts/Chat/ChatLayout.qml index 27378dcf9e..4964fb8927 100644 --- a/ui/app/AppLayouts/Chat/ChatLayout.qml +++ b/ui/app/AppLayouts/Chat/ChatLayout.qml @@ -234,8 +234,7 @@ StackLayout { Loader { id: communitySettingsLoader active: root.rootStore.chatCommunitySectionModule.isCommunity() && - root.isPrivilegedUser && - (root.currentIndex === 1 || !!communitySettingsLoader.item) // lazy load and preserve state after loading + root.isPrivilegedUser && root.currentIndex === 1 asynchronous: false // It's false on purpose. We want to load the component synchronously sourceComponent: CommunitySettingsView { id: communitySettingsView