Bind to Conversation lazily to prevent style guide errors

This commit is contained in:
Daniel Gasienica 2018-04-13 14:26:01 -04:00
parent 560cc4e149
commit 5f8148d3da

View file

@ -9,7 +9,7 @@
'use strict'; 'use strict';
window.Whisper = window.Whisper || {}; window.Whisper = window.Whisper || {};
const { Attachment, Conversation, Message } = window.Signal.Types; const { Attachment, Message } = window.Signal.Types;
const { upgradeMessageSchema, loadAttachmentData } = window.Signal.Migrations; const { upgradeMessageSchema, loadAttachmentData } = window.Signal.Migrations;
// TODO: Factor out private and group subclasses of Conversation // TODO: Factor out private and group subclasses of Conversation
@ -675,7 +675,7 @@
await collection.fetchConversation(this.id, 1); await collection.fetchConversation(this.id, 1);
const lastMessage = collection.at(0); const lastMessage = collection.at(0);
const lastMessageUpdate = Conversation.createLastMessageUpdate({ const lastMessageUpdate = Signal.Types.Conversation.createLastMessageUpdate({
currentLastMessageText: this.get('lastMessage') || null, currentLastMessageText: this.get('lastMessage') || null,
currentTimestamp: this.get('timestamp') || null, currentTimestamp: this.get('timestamp') || null,
lastMessage: lastMessage ? lastMessage.toJSON() : null, lastMessage: lastMessage ? lastMessage.toJSON() : null,