stream_edit: Remove unnacessary conditionals.

The condition was removed because in either case we
want to have the stream_row and not the sub/unsub
button, so we can always get the stream_row directly.
This commit is contained in:
clarammdantas 2020-04-26 16:36:28 -03:00 committed by Tim Abbott
parent 8f32db81a1
commit 25c5856988
1 changed files with 2 additions and 6 deletions

View File

@ -636,12 +636,8 @@ exports.initialize = function () {
// checkmark in the subscriber list.
$("#subscriptions_table").on("click", ".sub_unsub_button", function (e) {
const sub = get_sub_for_target(e.target);
let stream_row;
if ($(e.currentTarget).is(":button")) {
stream_row = $("#subscriptions_table div.stream-row[data-stream-id='" + sub.stream_id + "']");
} else {
stream_row = $(e.currentTarget).parent();
}
// Makes sure we take the correct stream_row.
const stream_row = $("#subscriptions_table div.stream-row[data-stream-id='" + sub.stream_id + "']");
subs.sub_or_unsub(sub, stream_row);
if (!sub.subscribed) {