mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 19:49:01 +01:00 
			
		
		
		
	fix(views/table): booleans not working
This commit is contained in:
		
							parent
							
								
									23cef0ab94
								
							
						
					
					
						commit
						b93a4a3e42
					
				| @ -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); | ||||
|  | ||||
| @ -24,8 +24,6 @@ export async function buildRowDefinitions(parentNote: FNote, notes: FNote[], inf | ||||
|         for (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); | ||||
|             } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran