ConversationView: when windows are closed, call unload()

Anyway, unload() is a more comprehensive method for doing what the close
handler was trying to do before.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-28 14:51:57 -07:00
parent 6f1a2a9b3e
commit c0f8812f9b

View file

@ -163,11 +163,7 @@
this.window.addEventListener('focus', this.onFocus);
extension.windows.onClosed(function () {
this.window.removeEventListener('resize', onResize);
this.window.removeEventListener('focus', onFocus);
window.autosize.destroy(this.$messageField);
this.remove();
this.model.messageCollection.reset([]);
this.unload();
}.bind(this));
this.fetchMessages();
@ -250,6 +246,8 @@
this.window.removeEventListener('resize', this.onResize);
this.window.removeEventListener('focus', this.onFocus);
window.autosize.destroy(this.$messageField);
this.view.remove();
this.remove();