Only update UI with sites once all info is fetched
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user