fix(@desktop/requestsToJoin): displaying approved people in the pending list (#13038)

This commit is contained in:
Mykhailo Prakhov 2023-12-21 11:30:02 +01:00 committed by GitHub
parent 273de8ca4b
commit 790add8ea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 8 deletions

View File

@ -714,24 +714,21 @@ QtObject:
if (not self.communities.contains(membershipRequest.communityId)):
error "Received a membership request for an unknown community", communityId=membershipRequest.communityId
continue
var community = self.communities[membershipRequest.communityId]
let requestToJoinState = RequestToJoinType(membershipRequest.state)
let noAwaitingIndex = self.getWaitingForSharedAddressesRequestIndex(membershipRequest.communityId, membershipRequest.id) == -1
if requestToJoinState == RequestToJoinType.AwaitingAddress and noAwaitingIndex:
community.waitingForSharedAddressesRequestsToJoin.add(membershipRequest)
self.communities[membershipRequest.communityId] = community
self.communities[membershipRequest.communityId].waitingForSharedAddressesRequestsToJoin.add(membershipRequest)
let myPublicKey = singletonInstance.userProfile.getPubKey()
if myPublicKey == membershipRequest.publicKey:
self.events.emit(SIGNAL_WAITING_ON_NEW_COMMUNITY_OWNER_TO_CONFIRM_REQUEST_TO_REJOIN, CommunityIdArgs(communityId: membershipRequest.communityId))
elif (requestToJoinState != RequestToJoinType.AwaitingAddress and noAwaitingIndex) and self.getPendingRequestIndex(membershipRequest.communityId, membershipRequest.id) == -1:
community.pendingRequestsToJoin.add(membershipRequest)
self.communities[membershipRequest.communityId] = community
elif RequestToJoinType.Pending == requestToJoinState and self.getPendingRequestIndex(membershipRequest.communityId, membershipRequest.id) == -1:
self.communities[membershipRequest.communityId].pendingRequestsToJoin.add(membershipRequest)
self.events.emit(SIGNAL_NEW_REQUEST_TO_JOIN_COMMUNITY,
CommunityRequestArgs(communityRequest: membershipRequest))
else:
try:
self.updateMembershipRequestToNewState(membershipRequest.communityId, membershipRequest.id, community,
self.updateMembershipRequestToNewState(membershipRequest.communityId, membershipRequest.id, self.communities[membershipRequest.communityId],
requestToJoinState)
except Exception as e:
error "Unknown request", msg = e.msg

2
vendor/status-go vendored

@ -1 +1 @@
Subproject commit 6d77fb771a2e2641b3f7664a38e1001fce63b4dd
Subproject commit 8cbdc807584d2c88186d7f43664183738dc86ef6