Applied correct business logic in EnergyManagementDataLoadingStrategy.

This commit is contained in:
Faris Armoush
2025-05-15 12:48:18 +03:00
parent 745205063e
commit baaf5111b1

View File

@ -14,7 +14,6 @@ class EnergyManagementDataLoadingStrategy implements AnalyticsDataLoadingStrateg
CommunityModel community, CommunityModel community,
List<SpaceModel> spaces, List<SpaceModel> spaces,
) { ) {
// Add to space tree bloc first
context.read<SpaceTreeBloc>().add( context.read<SpaceTreeBloc>().add(
OnCommunitySelected( OnCommunitySelected(
community.uuid, community.uuid,
@ -69,7 +68,9 @@ class EnergyManagementDataLoadingStrategy implements AnalyticsDataLoadingStrateg
CommunityModel community, CommunityModel community,
SpaceModel child, SpaceModel child,
) { ) {
// Do nothing else as per original implementation if (child.children.isNotEmpty) {
return onSpaceSelected(context, community, child);
}
} }
@override @override