2
0
mirror of https://github.com/status-im/status-go.git synced 2025-01-10 14:47:06 +00:00

fix: don't expect CommunityTokensMetadata in EditCommunity()

The `Edit()` method on `Community` merely updates "primitive" values
that live inside a community description. For any data that is more complex,
we typically have dedicated methods.

Because `Edit()` was expecting `CommunityTokensMetadata`, it would
override it with empty data every time we would edit a community.
This is because we typically don't update that kind of data as part
of `Edit()`.

In addition, `CommunityTokensMetadata` is append-only anyways,
so there wouldn't be any other way to update that field, other than
adding new items to it, which is done in a dedicated method.
This commit is contained in:
Pascal Precht 2023-03-07 14:42:06 +01:00 committed by r4bbit
parent 475b5f855f
commit a6194ffad4

@ -933,7 +933,6 @@ func (o *Community) Edit(description *protobuf.CommunityDescription) {
}
o.config.CommunityDescription.Permissions = description.Permissions
o.config.CommunityDescription.AdminSettings.PinMessageAllMembersEnabled = description.AdminSettings.PinMessageAllMembersEnabled
o.config.CommunityDescription.CommunityTokensMetadata = description.CommunityTokensMetadata
o.increaseClock()
}