diff --git a/web/src/typeahead_helper.js b/web/src/typeahead_helper.js index 080949afb0..9325b7d3d2 100644 --- a/web/src/typeahead_helper.js +++ b/web/src/typeahead_helper.js @@ -123,8 +123,8 @@ export function render_stream(stream) { } return render_typeahead_item({ - primary: stream.name, secondary: desc, + stream, is_unsubscribed: !stream.subscribed, }); } diff --git a/web/templates/typeahead_list_item.hbs b/web/templates/typeahead_list_item.hbs index 3b6b832194..49fb2f21c2 100644 --- a/web/templates/typeahead_list_item.hbs +++ b/web/templates/typeahead_list_item.hbs @@ -18,7 +18,11 @@ {{/if}} - {{~ primary ~}} + {{~#if stream}} + {{> inline_decorated_stream_name stream=stream }} + {{else}} + {{~ primary ~}} + {{/if}} {{~#if has_status}} {{> status_emoji status_emoji_info}} diff --git a/web/tests/typeahead_helper.test.js b/web/tests/typeahead_helper.test.js index 700d4c1768..fa4d02aeb7 100644 --- a/web/tests/typeahead_helper.test.js +++ b/web/tests/typeahead_helper.test.js @@ -722,7 +722,7 @@ test("render_stream", ({mock_template}) => { }; mock_template("typeahead_list_item.hbs", false, (args) => { - assert.equal(args.primary, stream.name); + assert.equal(args.stream, stream); assert.equal(args.secondary, stream.description); rendered = true; return "typeahead-item-stub"; @@ -741,7 +741,7 @@ test("render_stream w/long description", ({mock_template}) => { }; mock_template("typeahead_list_item.hbs", false, (args) => { - assert.equal(args.primary, stream.name); + assert.equal(args.stream, stream); const short_desc = stream.description.slice(0, 35); assert.equal(args.secondary, short_desc + "..."); rendered = true;