Signal user if the networks are not supported
This commit is contained in:
parent
5e905518aa
commit
598e3217ba
|
@ -12,6 +12,7 @@ type CheckPermissionsResponse struct {
|
|||
Satisfied bool `json:"satisfied"`
|
||||
Permissions map[string]*PermissionTokenCriteriaResult `json:"permissions"`
|
||||
ValidCombinations []*AccountChainIDsCombination `json:"validCombinations"`
|
||||
NetworksNotSupported bool `json:"networksNotSupported"`
|
||||
}
|
||||
|
||||
type CheckPermissionToJoinResponse = CheckPermissionsResponse
|
||||
|
@ -98,12 +99,14 @@ func (c *CheckPermissionsResponse) MarshalJSON() ([]byte, error) {
|
|||
ValidCombinations []*AccountChainIDsCombination `json:"validCombinations"`
|
||||
Roles []*HighestRoleResponse `json:"roles"`
|
||||
HighestRole *HighestRoleResponse `json:"highestRole"`
|
||||
NetworksNotSupported bool `json:"networksNotSupported"`
|
||||
}
|
||||
c.calculateSatisfied()
|
||||
item := &CheckPermissionsTypeAlias{
|
||||
Satisfied: c.Satisfied,
|
||||
Permissions: c.Permissions,
|
||||
ValidCombinations: c.ValidCombinations,
|
||||
NetworksNotSupported: c.NetworksNotSupported,
|
||||
}
|
||||
rolesAndHighestRole := calculateRolesAndHighestRole(c.Permissions)
|
||||
|
||||
|
|
|
@ -236,6 +236,7 @@ func (p *DefaultPermissionChecker) CheckPermissions(permissions []*CommunityToke
|
|||
// if there are no chain IDs that match token criteria chain IDs
|
||||
// we aren't able to check balances on selected networks
|
||||
if len(erc20ChainIDsMap) > 0 && len(chainIDsForERC20) == 0 {
|
||||
response.NetworksNotSupported = true
|
||||
return response, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue