include currentMonth if no changes in the features

This commit is contained in:
Hugoren Martinako 2024-04-25 16:20:24 +02:00
parent 49cb0033c8
commit 54d966af4a
1 changed files with 7 additions and 0 deletions

View File

@ -87,6 +87,13 @@ export default class Visor {
...new Set(this.baseData.features.flatMap(({ properties: { values } }) => Object.keys(values)))
].sort().filter(Boolean)
// in case no changes were made for the current month
const yyyymm = new Date().toISOString().slice(0, 7)
if (!this.currentMonths.includes(`${yyyymm}-01`)) {
console.info("No changes for the current month, pushed manually");
this.currentMonths.push(`${yyyymm}-01`)
}
// set the most up to date month
this.currentMonthIx = this.currentMonths.length - 1