Clean up stream renaming in the JS code.

We now use stream_id as our key to rename streams, which
should prevent a few race conditions long term.  (We are
still possibly contending with other events that use
stream_name as a key, so this is not perfect.)
This commit is contained in:
Steve Howell
2016-10-30 09:33:23 -07:00
committed by Tim Abbott
parent e1372ddf5d
commit 7509f73f02
4 changed files with 21 additions and 15 deletions

View File

@@ -524,8 +524,8 @@ exports.update_dom_with_unread_counts = function (counts) {
animate_mention_changes(counts.mentioned_message_count);
};
exports.rename_stream = function (sub) {
sub.sidebar_li = build_stream_sidebar_row(sub.name);
exports.rename_stream = function (sub, new_name) {
sub.sidebar_li = build_stream_sidebar_row(new_name);
exports.build_stream_list(); // big hammer
};