fix: ensure needed community tokens are available in the db
Fixes #13171
This commit is contained in:
parent
5cb1972261
commit
781a2c7c8e
|
@ -3667,6 +3667,10 @@ func (m *Messenger) RemoveCommunityToken(chainID int, contractAddress string) er
|
||||||
return m.communitiesManager.RemoveCommunityToken(chainID, contractAddress)
|
return m.communitiesManager.RemoveCommunityToken(chainID, contractAddress)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Messenger) FetchMissingCommunityTokens(community *communities.Community) error {
|
||||||
|
return m.communitiesManager.HandleCommunityTokensMetadata(community)
|
||||||
|
}
|
||||||
|
|
||||||
func (m *Messenger) CheckPermissionsToJoinCommunity(request *requests.CheckPermissionToJoinCommunity) (*communities.CheckPermissionToJoinResponse, error) {
|
func (m *Messenger) CheckPermissionsToJoinCommunity(request *requests.CheckPermissionToJoinCommunity) (*communities.CheckPermissionToJoinResponse, error) {
|
||||||
if err := request.Validate(); err != nil {
|
if err := request.Validate(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -674,6 +674,14 @@ func (s *Service) fetchCommunity(communityID string, fetchLatest bool) (*communi
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if community != nil {
|
||||||
|
// Call this to ensure CommunityTokens are stored to DB
|
||||||
|
err = s.messenger.FetchMissingCommunityTokens(community)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return community, nil
|
return community, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue