fix(descktop@community): show create/update/delete permissions toast notification for priviledged members only when it is approved by the control node (#13166)

This commit is contained in:
Mykhailo Prakhov 2024-01-10 19:16:26 +01:00 committed by GitHub
parent 9f2443f5e6
commit 5392da5361
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -778,6 +778,7 @@ method onCommunityTokenPermissionCreated*(self: Module, communityId: string, tok
self.view.tokenPermissionsModel.addItem(tokenPermissionItem)
self.reevaluateRequiresTokenPermissionToJoin()
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) =
@ -863,6 +864,7 @@ method onCommunityTokenPermissionUpdated*(self: Module, communityId: string, tok
self.view.tokenPermissionsModel.updateItem(tokenPermission.id, tokenPermissionItem)
self.reevaluateRequiresTokenPermissionToJoin()
if tokenPermission.state == TokenPermissionState.Approved:
singletonInstance.globalEvents.showCommunityTokenPermissionUpdatedNotification(communityId, "Community permission updated", "A token permission has been updated")
method onCommunityTokenPermissionCreationFailed*(self: Module, communityId: string) =