fix(communities): set state correctly on request accept or decline (#4144)

Fixes https://github.com/status-im/status-desktop/issues/12413
This commit is contained in:
Jonathan Rainville 2023-10-11 15:55:52 -04:00 committed by GitHub
parent 094228871e
commit 11f670636b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1988,6 +1988,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
}
}
dbRequest.State = RequestToJoinStateAccepted
if err := m.markRequestToJoinAsAccepted(pk, community); err != nil {
return nil, err
}
@ -2022,6 +2023,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
return nil, err
}
dbRequest.State = RequestToJoinStateAcceptedPending
if err := m.markRequestToJoinAsAcceptedPending(pk, community); err != nil {
return nil, err
}
@ -2057,6 +2059,7 @@ func (m *Manager) DeclineRequestToJoin(dbRequest *RequestToJoin) (*Community, er
requestToJoinState = RequestToJoinStateDeclinedPending // can only be declined by control node
}
dbRequest.State = requestToJoinState
err = m.persistence.SetRequestToJoinState(dbRequest.PublicKey, dbRequest.CommunityID, requestToJoinState)
if err != nil {
return nil, err