Do not optimistically set active_at & timestamp when sending edit
This commit is contained in:
parent
a2a6f207e3
commit
e9aa30f5bf
1 changed files with 6 additions and 2 deletions
|
@ -3791,14 +3791,18 @@ export class ConversationModel extends window.Backbone
|
||||||
lastMessageStatus: 'sending' as const,
|
lastMessageStatus: 'sending' as const,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isEditMessage = Boolean(message.get('editHistory'));
|
||||||
|
|
||||||
this.set({
|
this.set({
|
||||||
...draftProperties,
|
...draftProperties,
|
||||||
...(enabledProfileSharing ? { profileSharing: true } : {}),
|
...(enabledProfileSharing ? { profileSharing: true } : {}),
|
||||||
...(dontAddMessage
|
...(dontAddMessage
|
||||||
? {}
|
? {}
|
||||||
: this.incrementSentMessageCount({ dry: true })),
|
: this.incrementSentMessageCount({ dry: true })),
|
||||||
active_at: now,
|
// If it's an edit message we don't want to optimistically set the
|
||||||
timestamp: now,
|
// active_at & timestamp to now. We want it to stay the same.
|
||||||
|
active_at: isEditMessage ? this.get('active_at') : now,
|
||||||
|
timestamp: isEditMessage ? this.get('timestamp') : now,
|
||||||
...(unarchivedConversation ? { isArchived: false } : {}),
|
...(unarchivedConversation ? { isArchived: false } : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue