From 741717d3afd3cf21c4e83522599df79146a79656 Mon Sep 17 00:00:00 2001 From: tillvit Date: Thu, 6 Jun 2024 15:58:02 +0800 Subject: [PATCH] Remove table brackets for one export option for notedata --- app/src/gui/window/ExportNotedataWindow.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/gui/window/ExportNotedataWindow.ts b/app/src/gui/window/ExportNotedataWindow.ts index 92488cfa..d7031780 100644 --- a/app/src/gui/window/ExportNotedataWindow.ts +++ b/app/src/gui/window/ExportNotedataWindow.ts @@ -173,6 +173,11 @@ export class ExportNotedataWindow extends Window { str += "}" + if (this.getNumIncludes() == 1) { + str = str.replaceAll("{", "") + str = str.replaceAll("}", "") + } + return str }) .join(",\n") + @@ -182,6 +187,12 @@ export class ExportNotedataWindow extends Window { this.outputDiv!.innerText = exportText } + private getNumIncludes() { + return Object.values(this.exportOptions.include) + .map(option => +option) + .reduce((a, b) => a + b, 0) + } + private padNum(val: number) { if (this.exportOptions.options.padNumbers) return (Math.round(val * 1000) / 1000).toFixed(3)