Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(views/table): booleans not working
Elian Doranb93a4a3e42f0
diff --git a/apps/client/src/widgets/view_widgets/table_view/index.ts b/apps/client/src/widgets/view_widgets/table_view/index.tsindex 0b4e79c891..4294d32d3a 100644--- a/apps/client/src/widgets/view_widgets/table_view/index.ts+++ b/apps/client/src/widgets/view_widgets/table_view/index.ts@@ -159,7 +159,7 @@ export default class TableView extends ViewMode<StateInfo> {this.api!.on("cellEdited", async (cell) => {const noteId = cell.getRow().getData().noteId;const field = cell.getField();- const newValue = cell.getValue();+ let newValue = cell.getValue();if (field === "title") {server.put(`notes/${noteId}/title`, { title: newValue });@@ -169,6 +169,9 @@ export default class TableView extends ViewMode<StateInfo> {if (field.includes(".")) {const [ type, name ] = field.split(".", 2);if (type === "labels") {+ if (typeof newValue === "boolean") {+ newValue = newValue ? "true" : "false";+ }setLabel(noteId, name, newValue);} else if (type === "relations") {const note = await froca.getNote(noteId);diff --git a/apps/client/src/widgets/view_widgets/table_view/rows.ts b/apps/client/src/widgets/view_widgets/table_view/rows.tsindex 8263838bc2..04580150cf 100644--- a/apps/client/src/widgets/view_widgets/table_view/rows.ts+++ b/apps/client/src/widgets/view_widgets/table_view/rows.ts@@ -24,8 +24,6 @@ export async function buildRowDefinitions(parentNote: FNote, notes: FNote[], inffor (const { name, type } of infos) {if (type === "relation") {relations[name] = note.getRelationValue(name);- } else if (type === "boolean") {- labels[name] = note.hasLabel(name);} else {labels[name] = note.getLabelValue(name);}