From 25b0fbd949a33e23602e7a6495235b52acde9e8d Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 4 Apr 2017 18:42:58 -0700 Subject: [PATCH] Fix exceptions on window close The stopListening function was being passed the close event as an argument, which caused it to throw. // FREEBIE --- js/views/conversation_list_item_view.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/views/conversation_list_item_view.js b/js/views/conversation_list_item_view.js index ec56ad908..f8314c499 100644 --- a/js/views/conversation_list_item_view.js +++ b/js/views/conversation_list_item_view.js @@ -25,7 +25,9 @@ this.listenTo(this.model.messageCollection, 'add remove', updateLastMessage); this.listenTo(this.model, 'newmessage', updateLastMessage); - extension.windows.onClosed(this.stopListening.bind(this)); + extension.windows.onClosed(function() { + this.stopListening(); + }.bind(this)); this.timeStampView = new Whisper.TimestampView({brief: true}); this.model.updateLastMessage(); },