Avoid duplicate streams in the Administration page.

Before this change, you could open the Administration page
for a 2nd time, and there would be two copies of each stream.
The simple fix is to remove any existing rows before populating
the table.

(imported from commit 957306d9c6418e59b5b288dad08864547ca63e53)
This commit is contained in:
Steve Howell
2013-12-10 17:12:16 -05:00
parent a59760883d
commit c7abaff9e9

View File

@@ -52,7 +52,8 @@ function populate_users (realm_people_data) {
}
function populate_streams (streams_data) {
var streams_table = $("#admin_streams_table");
var streams_table = $("#admin_streams_table").expectOne();
streams_table.find("tr.stream_row").remove();
_.each(streams_data.streams, function (stream) {
streams_table.append(templates.render("admin_streams_list", {stream: stream}));
});