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.
This commit is contained in:
Jonathan Rainville 2024-09-27 13:42:23 -04:00
parent b8c4dfac34
commit 7c1d047199
1 changed files with 1 additions and 2 deletions

View File

@ -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