From e8bb9e2de1aab651cdb524ed68ef38a99f2cb903 Mon Sep 17 00:00:00 2001 From: sanchi-t Date: Thu, 26 Sep 2024 11:56:25 +0530 Subject: [PATCH] get_invite_stream_data: Do not display archived channels. User should not be able to sent invite for archived channels. --- web/src/stream_data.ts | 2 +- web/src/stream_pill.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/stream_data.ts b/web/src/stream_data.ts index a2683705b9..682ae78e0e 100644 --- a/web/src/stream_data.ts +++ b/web/src/stream_data.ts @@ -378,7 +378,7 @@ export function get_invite_stream_data(): StreamSubscription[] { const streams = []; const all_subs = get_unsorted_subs(); for (const sub of all_subs) { - if (can_subscribe_others(sub)) { + if (!sub.is_archived && can_subscribe_others(sub)) { streams.push(sub); } } diff --git a/web/src/stream_pill.ts b/web/src/stream_pill.ts index 25f33d36d6..be14111380 100644 --- a/web/src/stream_pill.ts +++ b/web/src/stream_pill.ts @@ -134,7 +134,10 @@ export function typeahead_source( const potential_streams = invite_streams ? stream_data.get_invite_stream_data() : stream_data.get_unsorted_subs(); - return filter_taken_streams(potential_streams, pill_widget).map((stream) => ({ + + const active_streams = potential_streams.filter((sub) => !sub.is_archived); + + return filter_taken_streams(active_streams, pill_widget).map((stream) => ({ ...stream, type: "stream", }));