Adding conditional to prevent adding multiple approval sync messages for the acceptor of the request.

pull/2222/head
warrickct 3 years ago
parent 2b84a53959
commit ba30dc57c2

@ -141,6 +141,7 @@ const handleContactReceived = async (
} }
if (contactReceived.isApproved === true) { if (contactReceived.isApproved === true) {
if (!contactConvo.isApproved()) {
// checking for existence of field on protobuf // checking for existence of field on protobuf
await contactConvo.setIsApproved(Boolean(contactReceived.isApproved)); await contactConvo.setIsApproved(Boolean(contactReceived.isApproved));
// TODO: add message search in convo for pre-existing msgRequestResponse msg only happens once per convo // TODO: add message search in convo for pre-existing msgRequestResponse msg only happens once per convo
@ -153,6 +154,7 @@ const handleContactReceived = async (
expireTimer: 0, expireTimer: 0,
}); });
contactConvo.updateLastMessage(); contactConvo.updateLastMessage();
}
if (contactReceived.didApproveMe === true) { if (contactReceived.didApproveMe === true) {
// checking for existence of field on message // checking for existence of field on message

Loading…
Cancel
Save