From c7abaff9e9e58c690f277e3ddbe870ca82dc012e Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 10 Dec 2013 17:12:16 -0500 Subject: [PATCH] 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) --- static/js/admin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/admin.js b/static/js/admin.js index 7ef384a512..15e43e491d 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -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})); });