mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 14:16:21 +00:00
0794edc3db
Fixes https://github.com/status-im/status-desktop/issues/16688 Since we use the local image server to show the community image, the URL never changes when we update the image, since it's served using a query string containing the community ID. eg: `https://Localhost:46739/communityDescriptionImages?communityID=0x03c5ece7da362d31199fb02d632f85fdf853af57d89c3204b4d1e90c6ec13bb23c&name=thumbnail` Because of that, the clients cannot know if the image was updated, so they had to force update the image every time, which was inefficient. We discovered this issue when I refactored the community client code in Desktop so that we only update the changed properties of a community instead of reseting the whole thing. The solution I came up with in the PR is to add a `version` to the URL when we detect that the image changed. This let's the clients detect when the image was updated without having to do any extra logic.
12 lines
501 B
Go
12 lines
501 B
Go
package server
|
|
|
|
import "github.com/status-im/status-go/protocol/protobuf"
|
|
|
|
type MediaServerInterface interface {
|
|
MakeCommunityDescriptionTokenImageURL(communityID, symbol string) string
|
|
MakeCommunityImageURL(communityID, name string) string
|
|
SetCommunityImageVersionReader(func(communityID string) uint32)
|
|
SetCommunityImageReader(func(communityID string) (map[string]*protobuf.IdentityImage, error))
|
|
SetCommunityTokensReader(func(communityID string) ([]*protobuf.CommunityTokenMetadata, error))
|
|
}
|