Skip to content

Commit 455a62c

Browse files
authored
Update Table.js
1 parent 86938cf commit 455a62c

File tree

1 file changed

+18
-6
lines changed
  • src/electron/frontend/core/components

1 file changed

+18
-6
lines changed

src/electron/frontend/core/components/Table.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -669,13 +669,24 @@ export class Table extends LitElement {
669669
if (cell) {
670670
let message = "";
671671
let theme = "";
672-
if (warnings.length) {
673-
((theme = "warning"), (message = warnings.map((error) => error.message).join("\n")));
674-
} else cell.removeAttribute("warning");
672+
if (warnings.length > 0) {
673+
theme = "warning";
674+
message = warnings
675+
.map(error => error.message)
676+
.join("\n");
677+
} else {
678+
cell.removeAttribute("warning");
679+
}
675680

676-
if (errors.length) {
677-
((theme = "error"), (message = errors.map((error) => error.message).join("\n"))); // Class switching handled automatically
678-
} else cell.removeAttribute("error");
681+
if (errors.length > 0) {
682+
theme = "error";
683+
// Class switching handled automatically
684+
message = errors
685+
.map(error => error.message)
686+
.join("\n");
687+
} else {
688+
cell.removeAttribute("error");
689+
}
679690

680691
if (theme) cell.setAttribute(theme, "");
681692

@@ -731,3 +742,4 @@ export class Table extends LitElement {
731742
}
732743

733744
customElements.get("nwb-table") || customElements.define("nwb-table", Table);
745+

0 commit comments

Comments
 (0)