From f118af8403687450554db6d407151daf4a6f38b6 Mon Sep 17 00:00:00 2001 From: Andrey Bocharnikov Date: Fri, 14 Jun 2024 15:39:17 +0400 Subject: [PATCH] fix(community): update hidden channels visibility when joining the community fixes #14719 --- monitoring/MonitorEntryPoint.qml | 10 +++++++++- src/app/modules/main/chat_section/model.nim | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/monitoring/MonitorEntryPoint.qml b/monitoring/MonitorEntryPoint.qml index 50171747b..e85ad503b 100644 --- a/monitoring/MonitorEntryPoint.qml +++ b/monitoring/MonitorEntryPoint.qml @@ -298,7 +298,15 @@ Component { text: "Note: 'applicationWindow' is good root object in" + " most cases. 'WalletStores.RootStore' and" + " `SharedStores.RootStore` are also exposed for" - + " convenience for models created within those singletons." + + " convenience for models created within those singletons. \n\n" + + " Hack (see #15181): If you want to inspect a model that is not" + + " from the root object (under a repeater), add objectName to a dummy object in AppMain.qml: \n" + + " property var modelIWantToInspect: SortFilterProxyModel { \n" + + " objectName: \"YYY\" \n" + + " } \n" + + " and inside your item add something like this: \n" + + " Component.onCompleted: appMain.modelIWantToInspect.sourceModel = this.model \n" + + " Then you can use 'YYY' as the object name in this search." } RowLayout { diff --git a/src/app/modules/main/chat_section/model.nim b/src/app/modules/main/chat_section/model.nim index f55e01d62..9aefe0053 100644 --- a/src/app/modules/main/chat_section/model.nim +++ b/src/app/modules/main/chat_section/model.nim @@ -428,6 +428,8 @@ QtObject: let modelIndex = self.createIndex(index, 0, nil) defer: modelIndex.delete + changedRoles.add(ModelRole.HideIfPermissionsNotMet.int) # depends on canPost, canView + changedRoles.add(ModelRole.ShouldBeHiddenBecausePermissionsAreNotMet.int) # depends on hideIfPermissionsNotMet self.dataChanged(modelIndex, modelIndex, changedRoles) proc changeMutedOnItemByCategoryId*(self: Model, categoryId: string, muted: bool) =