delete_sub: Do not remove archived stream when deactivated.

Stream is simply marked as `archived: true` instead of removing
the stream from `sub_store` and `stream_info`.

A check in `subscribe_myself` is added before subscribing to a
stream.
This commit is contained in:
sanchi-t
2024-07-02 00:49:22 +05:30
committed by Tim Abbott
parent fa268877d3
commit a29b6485d6
5 changed files with 35 additions and 6 deletions

View File

@@ -604,6 +604,7 @@ export function dispatch_normal_event(event) {
);
stream_data.delete_sub(stream.stream_id);
stream_settings_ui.remove_stream(stream.stream_id);
message_view_header.maybe_rerender_title_area_for_stream(stream);
if (was_subscribed) {
stream_list.remove_sidebar_row(stream.stream_id);
if (stream.stream_id === compose_state.selected_recipient_id) {
@@ -632,6 +633,7 @@ export function dispatch_normal_event(event) {
message_lists.current.update_trailing_bookend(true);
}
}
message_live_update.rerender_messages_view();
stream_list.update_subscribe_to_more_streams_link();
break;
default: