Properly wait when clearing messages
This commit is contained in:
parent
b4dafcc45b
commit
149fcf5d32
@ -377,8 +377,7 @@ converse.plugins.add('converse-chat', {
|
||||
|
||||
async clearMessages () {
|
||||
try {
|
||||
await Promise.all(this.messages.models.map(m => m.destroy()));
|
||||
this.messages.reset();
|
||||
await this.messages.clearSession();
|
||||
} catch (e) {
|
||||
this.messages.trigger('reset');
|
||||
log.error(e);
|
||||
@ -411,9 +410,9 @@ converse.plugins.add('converse-chat', {
|
||||
_converse.api.trigger('chatReconnected', this);
|
||||
},
|
||||
|
||||
onReconnection () {
|
||||
async onReconnection () {
|
||||
if (_converse.clear_messages_on_reconnection) {
|
||||
this.clearMessages();
|
||||
await this.clearMessages();
|
||||
}
|
||||
this.announceReconnection();
|
||||
},
|
||||
|
@ -409,7 +409,7 @@ converse.plugins.add('converse-muc', {
|
||||
this.removeNonMembers();
|
||||
await this.refreshRoomFeatures();
|
||||
if (_converse.clear_messages_on_reconnection) {
|
||||
this.clearMessages();
|
||||
await this.clearMessages();
|
||||
}
|
||||
if (!u.isPersistableModel(this)) {
|
||||
// XXX: Happens during tests, nothing to do if this
|
||||
|
Loading…
Reference in New Issue
Block a user