diff --git a/frontend_tests/node_tests/stream_data.js b/frontend_tests/node_tests/stream_data.js index 9415a140d3..f6136571ec 100644 --- a/frontend_tests/node_tests/stream_data.js +++ b/frontend_tests/node_tests/stream_data.js @@ -631,7 +631,7 @@ run_test('create_sub', () => { assert.equal(antarctica_sub.color, '#76ce90'); }); -run_test('initialize_from_page_params', () => { +run_test('initialize', () => { function initialize() { page_params.subscriptions = [{ name: 'subscriptions', @@ -651,7 +651,7 @@ run_test('initialize_from_page_params', () => { initialize(); page_params.realm_notifications_stream_id = -1; - stream_data.initialize_from_page_params(); + stream_data.initialize(); const stream_names = stream_data.get_streams_for_admin().map(elem => elem.name); assert(stream_names.indexOf('subscriptions') !== -1); @@ -665,7 +665,7 @@ run_test('initialize_from_page_params', () => { // Simulate a private stream the user isn't subscribed to initialize(); page_params.realm_notifications_stream_id = 89; - stream_data.initialize_from_page_params(); + stream_data.initialize(); assert.equal(page_params.notifications_stream, ""); // Now actually subscribe the user to the stream @@ -676,7 +676,7 @@ run_test('initialize_from_page_params', () => { }; stream_data.add_sub('foo', foo); - stream_data.initialize_from_page_params(); + stream_data.initialize(); assert.equal(page_params.notifications_stream, "foo"); }); diff --git a/static/js/stream_data.js b/static/js/stream_data.js index 6d2ed1abe7..98e774f58e 100644 --- a/static/js/stream_data.js +++ b/static/js/stream_data.js @@ -565,7 +565,7 @@ exports.get_streams_for_admin = function () { return subs; }; -exports.initialize_from_page_params = function () { +exports.initialize = function () { color_data.claim_colors(page_params.subscriptions); function populate_subscriptions(subs, subscribed, previously_subscribed) { diff --git a/static/js/subs.js b/static/js/subs.js index d85d37dd8d..98086ae7e7 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -770,7 +770,6 @@ exports.sub_or_unsub = function (sub) { exports.initialize = function () { - stream_data.initialize_from_page_params(); stream_list.create_initial_sidebar_rows(); // We build the stream_list now. It may get re-built again very shortly diff --git a/static/js/ui_init.js b/static/js/ui_init.js index d223f14531..657d62359a 100644 --- a/static/js/ui_init.js +++ b/static/js/ui_init.js @@ -283,6 +283,7 @@ $(function () { echo.initialize(); stream_color.initialize(); stream_edit.initialize(); + stream_data.initialize(); subs.initialize(); condense.initialize(); lightbox.initialize();