From 835dd6673ac3facf335e72bbf0c3bb6bf5f0f724 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Tue, 4 Jun 2013 16:07:44 -0400 Subject: [PATCH] Only reselect the selected message on rerender if it's not -1 We could get into this situation when someone is doing a search and someone else edits a message while the results are still loading. (imported from commit 99e371fd75c7ae7dc98a0c03bc434e434da44b94) --- zephyr/static/js/message_list.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zephyr/static/js/message_list.js b/zephyr/static/js/message_list.js index 8913b2a87d..80a27da788 100644 --- a/zephyr/static/js/message_list.js +++ b/zephyr/static/js/message_list.js @@ -589,7 +589,9 @@ MessageList.prototype = { // things. this._clear_rendering_state(); this._rerender_preserving_scrolltop(); - this.select_id(this._selected_id); + if (this._selected_id !== -1) { + this.select_id(this._selected_id); + } }, all: function MessageList_all() {