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(dashboard): handle gridstack v13 returning no grid from init
Elian Doran386435f58169
diff --git a/apps/client/src/widgets/collections/dashboard/index.tsx b/apps/client/src/widgets/collections/dashboard/index.tsxindex d043c1487e..8c77fa1eb4 100644--- a/apps/client/src/widgets/collections/dashboard/index.tsx+++ b/apps/client/src/widgets/collections/dashboard/index.tsx@@ -207,6 +207,10 @@ function useDashboardGrid({ note, notes, viewConfig, saveConfig, containerRef, gbreakpoints: [{ w: SINGLE_COLUMN_BREAKPOINT, c: 1 }]}}, container);+ // Gridstack only declines to initialize without a DOM (server-side rendering) or without the+ // element it was pointed at — neither happens once the container ref is attached.+ if (!grid) return;+gridRef.current = grid;grid.on("change", () => persistLayout(grid));