From afed6d36c910279388c58c1596389971a18b55f0 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 4 Mar 2022 20:52:05 +0000 Subject: [PATCH] select newly created list --- public/javascripts/lsl.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/javascripts/lsl.js b/public/javascripts/lsl.js index 3e5c672..4395c05 100644 --- a/public/javascripts/lsl.js +++ b/public/javascripts/lsl.js @@ -154,7 +154,7 @@ function delete_list(li, dlg) { }); } function load_lists() { - $.get(uri_base + '/api/v1/list') + return $.get(uri_base + '/api/v1/list') .always(()=>{ var splash = $('#splash'); if (splash.length) { @@ -216,7 +216,12 @@ function load_lists() { } function new_list_submission_done(data) { if (data.lists_version != lists_version) { - load_lists(); + load_lists() + .done((d)=>{ + var new_list = $('li#list-'+uri_id(data.uri)); + if (new_list.length) + select_list(new_list); + }); return; } -- 2.39.5