ConversationView.unload: Add ability to provide reason for logging

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-31 10:01:20 -07:00
parent c0f8812f9b
commit ec70170829

View file

@ -163,7 +163,7 @@
this.window.addEventListener('focus', this.onFocus);
extension.windows.onClosed(function () {
this.unload();
this.unload('windows closed');
}.bind(this));
this.fetchMessages();
@ -211,14 +211,14 @@
var oneHourAgo = Date.now() - 60 * 60 * 1000;
if (this.isHidden() && this.lastActivity < oneHourAgo) {
this.unload();
this.unload('inactivity');
} else if (this.view.atBottom()) {
this.trim();
}
},
unload: function() {
console.log('unloading conversation', this.model.id, 'due to inactivity');
unload: function(reason) {
console.log('unloading conversation', this.model.id, 'due to:', reason);
this.timerMenu.remove();
this.fileInput.remove();