fix: Bibliothek section always visible in left sidebar
- LeftSidebar was hiding entire Bibliothek section when blocks array was empty - Removed blocks.length > 0 conditional wrapper - Added blocks || [] fallback to prevent crash - Library tree now visible even with no blocks
This commit is contained in:
@@ -121,11 +121,10 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ activeTool, onToolChange, sel
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{blocks && blocks.length > 0 && (
|
<div className="tool-section" key="library">
|
||||||
<div className="tool-section" key="library">
|
<div className="tool-section-label">Bibliothek</div>
|
||||||
<div className="tool-section-label">Bibliothek</div>
|
|
||||||
<BlockLibrary
|
<BlockLibrary
|
||||||
blocks={blocks}
|
blocks={blocks || []}
|
||||||
category="Alle"
|
category="Alle"
|
||||||
onCategoryChange={onBlockCategoryChange ?? (() => {})}
|
onCategoryChange={onBlockCategoryChange ?? (() => {})}
|
||||||
onSearch={onBlockSearch ?? (() => {})}
|
onSearch={onBlockSearch ?? (() => {})}
|
||||||
@@ -136,8 +135,7 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ activeTool, onToolChange, sel
|
|||||||
onSvgImport={onSvgImport}
|
onSvgImport={onSvgImport}
|
||||||
onSaveGroupAsBlock={onSaveGroupAsBlock}
|
onSaveGroupAsBlock={onSaveGroupAsBlock}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="leftbar-footer">
|
<div className="leftbar-footer">
|
||||||
{onToggleCollapse && (
|
{onToggleCollapse && (
|
||||||
|
|||||||
Reference in New Issue
Block a user