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,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")