mirror of
https://github.com/status-im/status-go.git
synced 2025-02-16 16:56:53 +00:00
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:
parent
094228871e
commit
11f670636b
@ -1988,6 +1988,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbRequest.State = RequestToJoinStateAccepted
|
||||||
if err := m.markRequestToJoinAsAccepted(pk, community); err != nil {
|
if err := m.markRequestToJoinAsAccepted(pk, community); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -2022,6 +2023,7 @@ func (m *Manager) AcceptRequestToJoin(dbRequest *RequestToJoin) (*Community, err
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbRequest.State = RequestToJoinStateAcceptedPending
|
||||||
if err := m.markRequestToJoinAsAcceptedPending(pk, community); err != nil {
|
if err := m.markRequestToJoinAsAcceptedPending(pk, community); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -2057,6 +2059,7 @@ func (m *Manager) DeclineRequestToJoin(dbRequest *RequestToJoin) (*Community, er
|
|||||||
requestToJoinState = RequestToJoinStateDeclinedPending // can only be declined by control node
|
requestToJoinState = RequestToJoinStateDeclinedPending // can only be declined by control node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dbRequest.State = requestToJoinState
|
||||||
err = m.persistence.SetRequestToJoinState(dbRequest.PublicKey, dbRequest.CommunityID, requestToJoinState)
|
err = m.persistence.SetRequestToJoinState(dbRequest.PublicKey, dbRequest.CommunityID, requestToJoinState)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user