diff --git a/lib/pages/spaces_management/widgets/sidebar_widget.dart b/lib/pages/spaces_management/widgets/sidebar_widget.dart index 41a9e649..585b01b8 100644 --- a/lib/pages/spaces_management/widgets/sidebar_widget.dart +++ b/lib/pages/spaces_management/widgets/sidebar_widget.dart @@ -179,8 +179,8 @@ class _SidebarWidgetState extends State { // Check if this community is selected return CommunityTile( title: community.name, - key: ValueKey(community.uuid), - isSelected: _selectedId == community.uuid, + key: ValueKey(community.uuid), + isSelected: _selectedId == community.uuid, isExpanded: false, onItemSelected: () { setState(() { @@ -208,7 +208,7 @@ class _SidebarWidgetState extends State { // Check if space should be expanded return SpaceTile( title: space.name, - key: ValueKey(space.uuid), + key: ValueKey(space.uuid), isSelected: _selectedId == space.uuid, initiallyExpanded: isExpandedSpace, onExpansionChanged: (bool expanded) { @@ -221,6 +221,7 @@ class _SidebarWidgetState extends State { _selectedCommunityUuid = community.uuid; // Update selected community }); if (widget.onSpaceSelected != null) { + widget.onCommunitySelected!(community); widget.onSpaceSelected!(space); } },