From 252d0a6e15eb225b1d82682ebedef7677789c5a1 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 11 May 2017 16:09:11 -0700 Subject: [PATCH] Use stream_data.get_name() in narrow_state.stream(). Using get_name() is more robust for stream name changes. This fixes, for example, the situation where you narrow to a stream, edit it via the sidebar, and then close the modal, and the message redraw logic thinks you have unsubscribed. Fixes #4686. --- static/js/narrow_state.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/narrow_state.js b/static/js/narrow_state.js index 1538dddb91..ab45c1fcf6 100644 --- a/static/js/narrow_state.js +++ b/static/js/narrow_state.js @@ -98,7 +98,11 @@ exports.stream = function () { } var stream_operands = current_filter.operands("stream"); if (stream_operands.length === 1) { - return stream_operands[0]; + var name = stream_operands[0]; + + // Use get_name() to get the most current stream + // name (considering renames and capitalization). + return stream_data.get_name(name); } return undefined; };