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(board): not reacting to external title changes
Elian Doran254d3a1c8e73
diff --git a/apps/client/src/widgets/collections/board/card.tsx b/apps/client/src/widgets/collections/board/card.tsxindex 0ee92a11d8..b67a004087 100644--- a/apps/client/src/widgets/collections/board/card.tsx+++ b/apps/client/src/widgets/collections/board/card.tsx@@ -7,6 +7,7 @@ import { ContextMenuEvent } from "../../../menus/context_menu";import { openNoteContextMenu } from "./context_menu";import { t } from "../../../services/i18n";import UserAttributesDisplay from "../../attribute_widgets/UserAttributesList";+import { useTriliumEvent } from "../../react/hooks";export const CARD_CLIPBOARD_TYPE = "trilium/board-card";@@ -40,6 +41,13 @@ export default function Card({const [ isVisible, setVisible ] = useState(true);const [ title, setTitle ] = useState(note.title);+ useTriliumEvent("entitiesReloaded", ({ loadResults }) => {+ const row = loadResults.getEntityRow("notes", note.noteId);+ if (row) {+ setTitle(row.title);+ }+ });+const handleDragStart = useCallback((e: DragEvent) => {e.dataTransfer!.effectAllowed = 'move';const data: CardDragData = { noteId: note.noteId, branchId: branch.branchId, fromColumn: column, index };