ConversationView.unload: Add ability to provide reason for logging
FREEBIE
This commit is contained in:
parent
c0f8812f9b
commit
ec70170829
1 changed files with 4 additions and 4 deletions
|
@ -163,7 +163,7 @@
|
||||||
this.window.addEventListener('focus', this.onFocus);
|
this.window.addEventListener('focus', this.onFocus);
|
||||||
|
|
||||||
extension.windows.onClosed(function () {
|
extension.windows.onClosed(function () {
|
||||||
this.unload();
|
this.unload('windows closed');
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.fetchMessages();
|
this.fetchMessages();
|
||||||
|
@ -211,14 +211,14 @@
|
||||||
|
|
||||||
var oneHourAgo = Date.now() - 60 * 60 * 1000;
|
var oneHourAgo = Date.now() - 60 * 60 * 1000;
|
||||||
if (this.isHidden() && this.lastActivity < oneHourAgo) {
|
if (this.isHidden() && this.lastActivity < oneHourAgo) {
|
||||||
this.unload();
|
this.unload('inactivity');
|
||||||
} else if (this.view.atBottom()) {
|
} else if (this.view.atBottom()) {
|
||||||
this.trim();
|
this.trim();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
unload: function() {
|
unload: function(reason) {
|
||||||
console.log('unloading conversation', this.model.id, 'due to inactivity');
|
console.log('unloading conversation', this.model.id, 'due to:', reason);
|
||||||
|
|
||||||
this.timerMenu.remove();
|
this.timerMenu.remove();
|
||||||
this.fileInput.remove();
|
this.fileInput.remove();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue