fix txt.matchall

This commit is contained in:
ticaki
2024-01-23 18:17:34 +01:00
parent 49987d55ce
commit aa266da5ac

View File

@@ -6188,7 +6188,7 @@ function GenerateChartPage(page: NSPanel.PageChart): NSPanel.Payload[] {
let yAxisTicks : number[] = [];
if (!page.items[0].yAxisTicks) {
const sorted = [...txt.matchAll(timeValueRegEx)].map(x => Number(x[1])).sort((x, y) => x < y ? -1 : 1);
const sorted = [...String(txt).matchAll(timeValueRegEx)].map(x => Number(x[1])).sort((x, y) => x < y ? -1 : 1);
if (sorted.length === 0) {
throw new Error (`Page item ${id} yAxisTicks is undefined and unable to be calculated!`)
}