fix: expose token permission from events
Ensure token permission from events is returned by `tokenPermissions`.
This commit is contained in:
parent
2131bd3881
commit
8764170149
|
@ -1336,14 +1336,13 @@ func (o *Community) tokenPermissions() map[string]*CommunityTokenPermission {
|
||||||
|
|
||||||
switch event.Type {
|
switch event.Type {
|
||||||
case protobuf.CommunityEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE:
|
case protobuf.CommunityEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE:
|
||||||
tokenPermission := result[event.TokenPermission.Id]
|
eventsTokenPermission := NewCommunityTokenPermission(event.TokenPermission)
|
||||||
if tokenPermission != nil {
|
if result[event.TokenPermission.Id] != nil {
|
||||||
tokenPermission.State = TokenPermissionUpdatePending
|
eventsTokenPermission.State = TokenPermissionUpdatePending
|
||||||
} else {
|
} else {
|
||||||
tokenPermission := NewCommunityTokenPermission(event.TokenPermission)
|
eventsTokenPermission.State = TokenPermissionAdditionPending
|
||||||
tokenPermission.State = TokenPermissionAdditionPending
|
|
||||||
result[event.TokenPermission.Id] = tokenPermission
|
|
||||||
}
|
}
|
||||||
|
result[eventsTokenPermission.Id] = eventsTokenPermission
|
||||||
|
|
||||||
case protobuf.CommunityEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE:
|
case protobuf.CommunityEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE:
|
||||||
tokenPermission := result[event.TokenPermission.Id]
|
tokenPermission := result[event.TokenPermission.Id]
|
||||||
|
|
Loading…
Reference in New Issue