minor: Add comment explaining list_render.get call.

It's a bit confusing when you read this code to know
where the original list was created.  I'm not a huge
fan of the cache scheme here, but it does seem to
work for live updates.
This commit is contained in:
Steve Howell 2020-01-13 15:36:49 +00:00 committed by Tim Abbott
parent ea6934c26d
commit 90ed18d01a
1 changed files with 8 additions and 0 deletions

View File

@ -163,6 +163,14 @@ exports.update_subscribers_list = function (sub) {
$(".subscriber_list_settings_container").hide();
} else {
const emails = stream_edit.get_email_of_subscribers(sub.subscribers);
/*
We try to find a subscribers list that is already in the
cache that list_render.js maintains. The list we are
looking for would have been created in the function
stream_edit.show_subscription_settings, using the same
naming scheme as below for the `name` parameter.
*/
const subscribers_list = list_render.get("stream_subscribers/" + sub.stream_id);
// Changing the data clears the rendered list and the list needs to be re-rendered.