dont count drafts

This commit is contained in:
Barış Soner Uşaklı
2023-10-23 10:31:23 -04:00
parent 2ca5192b8a
commit 2a833ea476

View File

@@ -61,7 +61,7 @@ function buildTemplatesFromAreas(areas) {
templates.push({
template: area.template,
areas: [],
widgetCount: area.data.length,
widgetCount: area.location !== 'drafts' ? area.data.length : 0,
});
index += 1;
@@ -71,7 +71,9 @@ function buildTemplatesFromAreas(areas) {
name: area.name,
location: area.location,
});
templates[list[area.template]].widgetCount += area.data.length;
if (area.location !== 'drafts') {
templates[list[area.template]].widgetCount += area.data.length;
}
});
return templates;
}