Change actually_filter_streams to only run if subs overlay is open.

This change makes it such that the stream filtering operation will only
run if the subscription overlay is visible, preventing any issues with
the lack of existence of elements or processing something that users
won’t be able to see.

Fixes #3388.
This commit is contained in:
Brock Whittaker
2017-01-19 14:23:37 -08:00
committed by Tim Abbott
parent eccca8fc61
commit 2ed598c619

View File

@@ -698,9 +698,11 @@ function ajaxSubscribe(stream) {
url: "/json/users/me/subscriptions",
data: {subscriptions: JSON.stringify([{name: stream}]) },
success: function (resp, statusText, xhr) {
$("#create_stream_name").val("");
if (subs.is_open) {
$("#create_stream_name").val("");
actually_filter_streams();
actually_filter_streams();
}
var res = JSON.parse(xhr.responseText);
if (!$.isEmptyObject(res.already_subscribed)) {