Fixed view layouts after deleting a conversation.

pull/28/head
Mikunj 7 years ago
parent 0cf616328e
commit c583819ccf

@ -585,6 +585,13 @@
}
});
Whisper.events.on('deleteConversation', async conversation => {
await conversation.destroyMessages();
await window.Signal.Data.removeConversation(conversation.id, {
Conversation: Whisper.Conversation,
});
});
Whisper.Notifications.on('click', conversation => {
window.showWindow();
if (conversation) {
@ -602,7 +609,7 @@
if (messageReceiver) {
messageReceiver.onFriendRequestUpdate(pubKey, message);
}
})
});
Whisper.events.on('showFriendRequest', friendRequest => {
if (appView) {

@ -329,9 +329,7 @@
};
const onDelete = async () => {
await window.Signal.Data.removeConversation(conversation.id, {
Conversation: Whisper.Conversation,
})
window.Whisper.events.trigger('deleteConversation', conversation);
};
return {

@ -37,6 +37,12 @@
}
conversation.trigger('opened');
},
close(conversation) {
const $el = this.$(`#conversation-${conversation.cid}`);
if ($el && $el.length > 0) {
$el.remove();
}
}
});
Whisper.FontSizeView = Whisper.View.extend({
@ -138,10 +144,12 @@
'add change:timestamp change:name change:number',
this.inboxListView.updateLocation
);
this.inboxListView.listenTo(
// Listen to any conversation remove
this.listenTo(
inboxCollection,
'remove',
this.inboxListView.removeItem
this.closeConversation,
);
this.searchView = new Whisper.ConversationSearchView({
@ -274,6 +282,12 @@
this.focusConversation();
}
},
closeConversation(conversation) {
if (conversation) {
this.inboxListView.removeItem(conversation);
this.conversation_stack.close(conversation);
}
},
closeRecording(e) {
if (e && this.$(e.target).closest('.capture-audio').length > 0) {
return;

Loading…
Cancel
Save