message_feed: Remove separate Subscribe/Unsubscribe buttons.

This removes Subscribe/Unsubscribe buttons in trailing bookends,
including the can_toggle_subscription plumbing supporting them.

Fixes #32125.
This commit is contained in:
Harsh 2024-11-07 23:33:50 +05:30 committed by Tim Abbott
parent 8356a9d9e4
commit a8f76f1b80
4 changed files with 0 additions and 17 deletions

View File

@ -430,8 +430,6 @@ export class MessageList {
const subscribed = stream_data.is_subscribed(stream_id);
const invite_only = sub?.invite_only;
const is_web_public = sub?.is_web_public;
const can_toggle_subscription =
sub !== undefined && stream_data.can_toggle_subscription(sub);
if (sub === undefined || sub.is_archived) {
deactivated = true;
} else if (!subscribed && !this.last_message_historical) {
@ -443,7 +441,6 @@ export class MessageList {
subscribed,
deactivated,
just_unsubscribed,
can_toggle_subscription,
page_params.is_spectator,
invite_only ?? false,
is_web_public ?? false,

View File

@ -1953,7 +1953,6 @@ export class MessageListView {
subscribed: boolean,
deactivated: boolean,
just_unsubscribed: boolean,
can_toggle_subscription: boolean,
is_spectator: boolean,
invite_only: boolean,
is_web_public: boolean,
@ -1963,7 +1962,6 @@ export class MessageListView {
const $rendered_trailing_bookend = $(
render_bookend({
stream_name,
can_toggle_subscription,
subscribed,
deactivated,
just_unsubscribed,

View File

@ -26,15 +26,4 @@
{{/if}}
</span>
{{/if}}
{{#if can_toggle_subscription}}
<div class="sub_button_row">
<button class="button white rounded stream_sub_unsub_button {{#unless subscribed}}sea-green{{/unless}}" type="button" name="subscription">
{{#if subscribed}}
{{t 'Unsubscribe' }}
{{else}}
{{t 'Subscribe' }}
{{/if}}
</button>
</div>
{{/if}}
</div>

View File

@ -359,7 +359,6 @@ run_test("bookend", ({override}) => {
override(stream_data, "is_subscribed", () => is_subscribed);
override(stream_data, "get_sub_by_id", () => ({invite_only, name: "IceCream"}));
override(stream_data, "can_toggle_subscription", () => true);
{
const stub = make_stub();