From ffe3776b5fbce5a63b76ef39bf812c49df388c24 Mon Sep 17 00:00:00 2001 From: YJDave Date: Sun, 26 Nov 2017 17:27:03 +0530 Subject: [PATCH] create stream: Show current user on top of "People to add" list Fixes #7475 --- static/js/stream_create.js | 9 +++++---- static/templates/new_stream_users.handlebars | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/static/js/stream_create.js b/static/js/stream_create.js index 483af616f2..477952a22d 100644 --- a/static/js/stream_create.js +++ b/static/js/stream_create.js @@ -164,9 +164,6 @@ function create_stream() { var is_invite_only = $('#stream_creation_form input[name=privacy]:checked').val() === "invite-only"; var principals = get_principals(); - // You are always subscribed to streams you create. - principals.push(people.my_current_email()); - created_stream = stream_name; var announce = (!!page_params.notifications_stream && @@ -218,8 +215,12 @@ exports.new_stream_clicked = function (stream_name) { exports.show_new_stream_modal = function () { $("#stream-creation").removeClass("hide"); $(".right .settings").hide(); + + var all_users = people.get_rest_of_realm(); + // Add current user on top of list + all_users.unshift(people.get_person_from_user_id(page_params.user_id)); $('#people_to_add').html(templates.render('new_stream_users', { - users: people.get_rest_of_realm(), + users: all_users, streams: stream_data.get_streams_for_settings_page(), })); diff --git a/static/templates/new_stream_users.handlebars b/static/templates/new_stream_users.handlebars index 8c28114e14..f19a7840c1 100644 --- a/static/templates/new_stream_users.handlebars +++ b/static/templates/new_stream_users.handlebars @@ -30,7 +30,7 @@
{{#each users}}