Only update UI with sites once all info is fetched

This commit is contained in:
Johannes Zellner
2025-09-29 10:05:25 +02:00
parent 39e6463d19
commit daa4f7dfb1
+4 -3
View File
@@ -163,9 +163,9 @@ async function refresh() {
const [error, results] = await backupSitesModels.list();
if (error) return console.error(error);
sites.value = [];
const sortedResults = results.sort((a, b) => a.name.localeCompare(b.name));
const sitesWithDetails = [];
for (const result of sortedResults) {
// have to make it a reactive object as we manipulate property objects
const site = reactive(result);
@@ -190,9 +190,10 @@ async function refresh() {
if (site.task && site.task.active) setTimeout(waitForSiteTask.bind(null, site), 2000);
sites.value.push(site);
sitesWithDetails.push(site);
}
sites.value = sitesWithDetails;
busy.value = false;
}