From 5392da53619c9d72d31e26a8a55953c47db9eaef Mon Sep 17 00:00:00 2001 From: Mykhailo Prakhov Date: Wed, 10 Jan 2024 19:16:26 +0100 Subject: [PATCH] fix(descktop@community): show create/update/delete permissions toast notification for priviledged members only when it is approved by the control node (#13166) --- src/app/modules/main/chat_section/module.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/modules/main/chat_section/module.nim b/src/app/modules/main/chat_section/module.nim index 15a00380c9..373b7cbea7 100644 --- a/src/app/modules/main/chat_section/module.nim +++ b/src/app/modules/main/chat_section/module.nim @@ -778,7 +778,8 @@ method onCommunityTokenPermissionCreated*(self: Module, communityId: string, tok self.view.tokenPermissionsModel.addItem(tokenPermissionItem) self.reevaluateRequiresTokenPermissionToJoin() - singletonInstance.globalEvents.showCommunityTokenPermissionCreatedNotification(communityId, "Community permission created", "A token permission has been added") + if tokenPermission.state == TokenPermissionState.Approved: + singletonInstance.globalEvents.showCommunityTokenPermissionCreatedNotification(communityId, "Community permission created", "A token permission has been added") proc updateTokenPermissionModel*(self: Module, permissions: Table[string, CheckPermissionsResultDto], community: CommunityDto) = for id, criteriaResult in permissions: @@ -863,7 +864,8 @@ method onCommunityTokenPermissionUpdated*(self: Module, communityId: string, tok self.view.tokenPermissionsModel.updateItem(tokenPermission.id, tokenPermissionItem) self.reevaluateRequiresTokenPermissionToJoin() - singletonInstance.globalEvents.showCommunityTokenPermissionUpdatedNotification(communityId, "Community permission updated", "A token permission has been updated") + if tokenPermission.state == TokenPermissionState.Approved: + singletonInstance.globalEvents.showCommunityTokenPermissionUpdatedNotification(communityId, "Community permission updated", "A token permission has been updated") method onCommunityTokenPermissionCreationFailed*(self: Module, communityId: string) = singletonInstance.globalEvents.showCommunityTokenPermissionCreationFailedNotification(communityId, "Failed to create community permission", "Something went wrong")