Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stream_pill: Remove unused show_subscriber_count field.
Aadyot1f32e7ed0a208
diff --git a/web/src/invite.ts b/web/src/invite.tsindex bf186974f29..6097a30322d 100644--- a/web/src/invite.ts+++ b/web/src/invite.ts@@ -476,7 +476,7 @@ function update_stream_list(): void {for (const stream_id of guest_invite_stream_ids) {const sub = stream_data.get_sub_by_id(stream_id);if (sub) {- stream_pill.append_stream(sub, stream_pill_widget, false);+ stream_pill.append_stream(sub, stream_pill_widget);}}} else {diff --git a/web/src/invite_stream_picker_pill.ts b/web/src/invite_stream_picker_pill.tsindex 1ebec54ca22..a1f4781cd00 100644--- a/web/src/invite_stream_picker_pill.ts+++ b/web/src/invite_stream_picker_pill.ts@@ -16,13 +16,11 @@ function create_item_from_stream_name(): StreamPill | undefined {const stream_prefix_required = false;const get_allowed_streams = stream_data.get_invite_stream_data;- const show_stream_sub_count = false;return stream_pill.create_item_from_stream_name(stream_name,current_items,stream_prefix_required,get_allowed_streams,- show_stream_sub_count,);}@@ -40,7 +38,7 @@ export function add_default_stream_pills(pill_widget: stream_pill.StreamPillWidgfor (const stream_id of default_stream_ids) {const sub = stream_data.get_sub_by_id(stream_id);if (sub) {- stream_pill.append_stream(sub, pill_widget, false);+ stream_pill.append_stream(sub, pill_widget);}}}diff --git a/web/src/pill_typeahead.ts b/web/src/pill_typeahead.tsindex 309b6eac977..d9fbdc70d26 100644--- a/web/src/pill_typeahead.ts+++ b/web/src/pill_typeahead.ts@@ -130,7 +130,7 @@ export function set_up_stream(return typeahead_helper.sort_streams_by_name(stream_matches, query);},updater(item: StreamPillData, _query: string): undefined {- stream_pill.append_stream(item, pills, false);+ stream_pill.append_stream(item, pills);$input.trigger("focus");opts.update_func?.();},diff --git a/web/src/stream_pill.ts b/web/src/stream_pill.tsindex 9393efc7324..17e5a27ffcb 100644--- a/web/src/stream_pill.ts+++ b/web/src/stream_pill.ts@@ -11,7 +11,6 @@ import type {CombinedPill, CombinedPillContainer} from "./typeahead_helper.ts";export type StreamPill = {type: "stream";stream_id: number;- show_subscriber_count: boolean;};export type StreamPillWidget = InputPillContainer<StreamPill>;@@ -23,7 +22,6 @@ export function create_item_from_stream_name(current_items: CombinedPill[],stream_prefix_required = true,get_allowed_streams: () => StreamSubscription[] = stream_data.get_unsorted_subs,- show_subscriber_count = true,): StreamPill | undefined {stream_name = stream_name.trim();if (stream_prefix_required) {@@ -49,7 +47,6 @@ export function create_item_from_stream_name(return {type: "stream",- show_subscriber_count,stream_id: sub.stream_id,};}@@ -106,11 +103,9 @@ export function generate_pill_html(item: StreamPill): string {export function append_stream(stream: StreamSubscription,pill_widget: StreamPillWidget | CombinedPillContainer,- show_subscriber_count = true,): void {pill_widget.appendValidatedData({type: "stream",- show_subscriber_count,stream_id: stream.stream_id,});pill_widget.clear_text();diff --git a/web/tests/stream_pill.test.cjs b/web/tests/stream_pill.test.cjsindex efe0e8f0cbd..abeeb60393d 100644--- a/web/tests/stream_pill.test.cjs+++ b/web/tests/stream_pill.test.cjs@@ -72,12 +72,10 @@ const germany = make_stream({const denmark_pill = {type: "stream",stream_id: denmark.stream_id,- show_subscriber_count: true,};const sweden_pill = {type: "stream",stream_id: sweden.stream_id,- show_subscriber_count: true,};const subs = [denmark, sweden, germany];@@ -124,8 +122,6 @@ run_test("create_item", ({override}) => {run_test("display_value", () => {assert.deepEqual(stream_pill.get_display_value_from_item(denmark_pill), "Denmark");assert.deepEqual(stream_pill.get_display_value_from_item(sweden_pill), "Sweden");- sweden_pill.show_subscriber_count = false;- assert.deepEqual(stream_pill.get_display_value_from_item(sweden_pill), "Sweden");});run_test("get_stream_id", () => {