models/messages.initialize: If no ourConversationId, skip migration
This commit is contained in:
parent
09124446a6
commit
c35f901387
1 changed files with 13 additions and 9 deletions
|
@ -226,15 +226,19 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
);
|
||||
}
|
||||
|
||||
const sendStateByConversationId = migrateLegacySendAttributes(
|
||||
this.attributes,
|
||||
window.ConversationController.get.bind(window.ConversationController),
|
||||
window.ConversationController.getOurConversationIdOrThrow()
|
||||
);
|
||||
if (sendStateByConversationId) {
|
||||
this.set('sendStateByConversationId', sendStateByConversationId, {
|
||||
silent: true,
|
||||
});
|
||||
const ourConversationId =
|
||||
window.ConversationController.getOurConversationId();
|
||||
if (ourConversationId) {
|
||||
const sendStateByConversationId = migrateLegacySendAttributes(
|
||||
this.attributes,
|
||||
window.ConversationController.get.bind(window.ConversationController),
|
||||
ourConversationId
|
||||
);
|
||||
if (sendStateByConversationId) {
|
||||
this.set('sendStateByConversationId', sendStateByConversationId, {
|
||||
silent: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.CURRENT_PROTOCOL_VERSION = Proto.DataMessage.ProtocolVersion.CURRENT;
|
||||
|
|
Loading…
Reference in a new issue