fixed community selection

This commit is contained in:
hannathkadher
2024-11-21 19:39:55 +04:00
parent 4a9d99d7b0
commit 6f554dc941

View File

@ -179,8 +179,8 @@ class _SidebarWidgetState extends State<SidebarWidget> {
// 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<SidebarWidget> {
// 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<SidebarWidget> {
_selectedCommunityUuid = community.uuid; // Update selected community
});
if (widget.onSpaceSelected != null) {
widget.onCommunitySelected!(community);
widget.onSpaceSelected!(space);
}
},