mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
stream_settings_ui: Remove set_muted wrapper.
stream_muting.update_is_muted will be called when the event comes back from the server. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
61b9cff89b
commit
4595be29e8
@@ -14,7 +14,6 @@ import * as settings_ui from "./settings_ui";
|
|||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
import * as stream_edit from "./stream_edit";
|
import * as stream_edit from "./stream_edit";
|
||||||
import * as stream_settings_data from "./stream_settings_data";
|
import * as stream_settings_data from "./stream_settings_data";
|
||||||
import * as stream_settings_ui from "./stream_settings_ui";
|
|
||||||
import * as sub_store from "./sub_store";
|
import * as sub_store from "./sub_store";
|
||||||
import * as ui_util from "./ui_util";
|
import * as ui_util from "./ui_util";
|
||||||
import * as unread_ui from "./unread_ui";
|
import * as unread_ui from "./unread_ui";
|
||||||
@@ -326,8 +325,9 @@ export function initialize() {
|
|||||||
const stream_id = Number.parseInt($row.attr("data-stream-id"), 10);
|
const stream_id = Number.parseInt($row.attr("data-stream-id"), 10);
|
||||||
const sub = sub_store.get(stream_id);
|
const sub = sub_store.get(stream_id);
|
||||||
|
|
||||||
stream_settings_ui.set_muted(
|
stream_edit.set_stream_property(
|
||||||
sub,
|
sub,
|
||||||
|
"is_muted",
|
||||||
!sub.is_muted,
|
!sub.is_muted,
|
||||||
$row.closest(".subsection-parent").find(".alert-notification"),
|
$row.closest(".subsection-parent").find(".alert-notification"),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -310,8 +310,9 @@ function stream_is_muted_changed(e) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream_settings_ui.set_muted(
|
set_stream_property(
|
||||||
sub,
|
sub,
|
||||||
|
"is_muted",
|
||||||
e.target.checked,
|
e.target.checked,
|
||||||
`#stream_change_property_status${CSS.escape(sub.stream_id)}`,
|
`#stream_change_property_status${CSS.escape(sub.stream_id)}`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import * as settings_data from "./settings_data";
|
|||||||
import * as stream_bar from "./stream_bar";
|
import * as stream_bar from "./stream_bar";
|
||||||
import * as stream_color from "./stream_color";
|
import * as stream_color from "./stream_color";
|
||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
|
import * as stream_edit from "./stream_edit";
|
||||||
import * as stream_settings_ui from "./stream_settings_ui";
|
import * as stream_settings_ui from "./stream_settings_ui";
|
||||||
import * as sub_store from "./sub_store";
|
import * as sub_store from "./sub_store";
|
||||||
import * as ui_report from "./ui_report";
|
import * as ui_report from "./ui_report";
|
||||||
@@ -152,7 +153,7 @@ function build_stream_popover(opts) {
|
|||||||
$popper.on("click", ".toggle_stream_muted", (e) => {
|
$popper.on("click", ".toggle_stream_muted", (e) => {
|
||||||
const sub = stream_popover_sub(e);
|
const sub = stream_popover_sub(e);
|
||||||
hide_stream_popover();
|
hide_stream_popover();
|
||||||
stream_settings_ui.set_muted(sub, !sub.is_muted);
|
stream_edit.set_stream_property(sub, "is_muted", !sub.is_muted);
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import * as stream_data from "./stream_data";
|
|||||||
import * as stream_edit from "./stream_edit";
|
import * as stream_edit from "./stream_edit";
|
||||||
import * as stream_edit_subscribers from "./stream_edit_subscribers";
|
import * as stream_edit_subscribers from "./stream_edit_subscribers";
|
||||||
import * as stream_list from "./stream_list";
|
import * as stream_list from "./stream_list";
|
||||||
import * as stream_muting from "./stream_muting";
|
|
||||||
import * as stream_settings_data from "./stream_settings_data";
|
import * as stream_settings_data from "./stream_settings_data";
|
||||||
import * as stream_ui_updates from "./stream_ui_updates";
|
import * as stream_ui_updates from "./stream_ui_updates";
|
||||||
import * as sub_store from "./sub_store";
|
import * as sub_store from "./sub_store";
|
||||||
@@ -151,11 +150,6 @@ function should_list_all_streams() {
|
|||||||
return !page_params.realm_is_zephyr_mirror_realm;
|
return !page_params.realm_is_zephyr_mirror_realm;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function set_muted(sub, is_muted, status_element) {
|
|
||||||
stream_muting.update_is_muted(sub, is_muted);
|
|
||||||
stream_edit.set_stream_property(sub, "is_muted", sub.is_muted, status_element);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function toggle_pin_to_top_stream(sub) {
|
export function toggle_pin_to_top_stream(sub) {
|
||||||
stream_edit.set_stream_property(sub, "pin_to_top", !sub.pin_to_top);
|
stream_edit.set_stream_property(sub, "pin_to_top", !sub.pin_to_top);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user