Prevent duplicate message history disclaimers

This commit is contained in:
Ken Powers 2020-06-12 17:07:45 -04:00 committed by Scott Nonnenberg
parent b290a27173
commit 9f1304bca8

View file

@ -1666,6 +1666,15 @@
},
async addMessageHistoryDisclaimer() {
const lastMessage = this.messageCollection.last();
if (
lastMessage &&
lastMessage.get('type') === 'message-history-unsynced'
) {
// We do not need another message history disclaimer
return lastMessage;
}
const timestamp = Date.now();
const model = new Whisper.Message({