get_invite_stream_data: Do not display archived channels.

User should not be able to sent invite for archived channels.
This commit is contained in:
sanchi-t 2024-09-26 11:56:25 +05:30 committed by Tim Abbott
parent dbc90ba2e5
commit e8bb9e2de1
2 changed files with 5 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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",
}));