subscriptions: Fix buggy behaviour of click event handlers.

This commit fixes a bug where clicking on a stream row on the left
in the subscriptions table called the ".stream-row" as well as the
".sub_unsub_button" click events in `stream_edit.js`.

This caused the stream subscription to toggle everytime the row was
clicked. Also, this bug is only observed if the ".sub_unsub_button"
had been clicked first.
This commit is contained in:
Ryan Rehman 2020-07-06 23:59:29 +05:30 committed by Tim Abbott
parent ca99d62b4e
commit c234b4f254
1 changed files with 1 additions and 1 deletions

View File

@ -709,7 +709,7 @@ exports.initialize = function () {
// This handler isn't part of the normal edit interface; it's the convenient
// checkmark in the subscriber list.
$("#subscriptions_table").on("click", ".sub_unsub_button", (e) => {
$("#subscriptions_table").on("click", ".check.sub_unsub_button", (e) => {
const sub = get_sub_for_target(e.target);
// Makes sure we take the correct stream_row.
const stream_row = $("#subscriptions_table div.stream-row[data-stream-id='" + sub.stream_id + "']");