feat: make sure changes are needed before calling commit()

pull/2789/head
William Grant 2 years ago
parent d40b2d16b8
commit 5f8cb35f8a

@ -727,7 +727,11 @@ export async function updateConversationInteractionState({
status: ConversationInteractionStatus;
}) {
const convo = getConversationController().get(conversationId);
if (convo) {
if (
convo &&
(type !== convo.get('lastMessageInteractionType') ||
status !== convo.get('lastMessageInteractionStatus'))
) {
convo.set('lastMessageInteractionType', type);
convo.set('lastMessageInteractionStatus', status);
@ -748,7 +752,10 @@ export async function clearConversationInteractionState({
conversationId: string;
}) {
const convo = getConversationController().get(conversationId);
if (convo) {
if (
convo &&
(convo.get('lastMessageInteractionType') || convo.get('lastMessageInteractionStatus'))
) {
convo.set('lastMessageInteractionType', undefined);
convo.set('lastMessageInteractionStatus', undefined);

Loading…
Cancel
Save