parent
6154dbb8db
commit
b602533084
1 changed files with 11 additions and 9 deletions
|
@ -167,15 +167,17 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
sendSyncMessage: function() {
|
sendSyncMessage: function() {
|
||||||
var dataMessage = this.get('dataMessage');
|
this.syncPromise = this.syncPromise || Promise.resolve();
|
||||||
if (this.get('synced') || !dataMessage) {
|
this.syncPromise = this.syncPromise.then(function() {
|
||||||
return;
|
var dataMessage = this.get('dataMessage');
|
||||||
}
|
if (this.get('synced') || !dataMessage) {
|
||||||
|
return;
|
||||||
textsecure.messaging.sendSyncMessage(
|
}
|
||||||
dataMessage, this.get('sent_at'), this.get('destination')
|
return textsecure.messaging.sendSyncMessage(
|
||||||
).then(function() {
|
dataMessage, this.get('sent_at'), this.get('destination')
|
||||||
this.save({synced: true, dataMessage: null});
|
).then(function() {
|
||||||
|
this.save({synced: true, dataMessage: null});
|
||||||
|
}.bind(this));
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue