settings: Fix reuse of .stream-row class name.

The stream-specific notifications table incorrectly used the
.stream-row CSS class. As a result, live-update code for the "stream
settings" UI when changing a stream's permissions model would
incorrectly replace rows of this table with a "Manage streams" style
row.
This commit is contained in:
Tim Abbott
2022-11-09 15:22:29 -08:00
parent 70dbeb197f
commit c22de76af7
2 changed files with 6 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ function rerender_ui() {
const unmatched_streams =
stream_settings_data.get_unmatched_streams_for_notification_settings();
$unmatched_streams_table.find(".stream-row").remove();
$unmatched_streams_table.find(".stream-notifications-row").remove();
const muted_stream_ids = stream_data.muted_stream_ids();
@@ -249,7 +249,9 @@ export function update_page(settings_panel) {
export function update_muted_stream_state(sub) {
const $row = $(
`#stream-specific-notify-table .stream-row[data-stream-id='${CSS.escape(sub.stream_id)}']`,
`#stream-specific-notify-table .stream-notifications-row[data-stream-id='${CSS.escape(
sub.stream_id,
)}']`,
);
$row.toggleClass("control-label-disabled", sub.is_muted);
@@ -275,7 +277,7 @@ export function initialize() {
$("body").on("click", "#stream-specific-notify-table .unmute_stream", (e) => {
e.preventDefault();
e.stopPropagation();
const $row = $(e.currentTarget).closest(".stream-row");
const $row = $(e.currentTarget).closest(".stream-notifications-row");
const stream_id = Number.parseInt($row.attr("data-stream-id"), 10);
const sub = sub_store.get(stream_id);

View File

@@ -1,4 +1,4 @@
<tr class="stream-row {{#if muted}}control-label-disabled{{/if}}" data-stream-id="{{stream.stream_id}}">
<tr class="stream-notifications-row {{#if muted}}control-label-disabled{{/if}}" data-stream-id="{{stream.stream_id}}">
<td>
<span id="stream_privacy_swatch_{{stream.stream_id}}" class="stream-privacy filter-icon">
{{> ../stream_privacy