refactor admin navigation; update links to ingest pages and improve loading of data in parallel
This commit is contained in:
@@ -24,9 +24,12 @@ async function loadSources() {
|
||||
|
||||
|
||||
function getFilters() {
|
||||
const sel = document.getElementById("f-source");
|
||||
return {
|
||||
keyword: document.getElementById("f-keyword").value.trim(),
|
||||
source: document.getElementById("f-source").value,
|
||||
// fall back to url when the dropdown hasn't populated yet —
|
||||
// lets us fire loadArticles in parallel with loadSources on init
|
||||
source: sel.value || queryGet("source"),
|
||||
content_status: document.getElementById("f-status").value,
|
||||
from: document.getElementById("f-from").value,
|
||||
to: document.getElementById("f-to").value,
|
||||
@@ -184,6 +187,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
}
|
||||
};
|
||||
|
||||
await loadSources(); // wait for dropdown to render the saved source selection
|
||||
loadArticles();
|
||||
// both calls can run concurrently — loadArticles falls back to the
|
||||
// url param for source until the dropdown finishes populating.
|
||||
await Promise.all([loadSources(), loadArticles()]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user