mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 09:17:37 +00:00
SP-1591
This commit is contained in:
@ -28,7 +28,7 @@ final class AirQualityDataLoadingStrategy implements AnalyticsDataLoadingStrateg
|
|||||||
final isSpaceSelected = selectedSpacesIds.contains(space.uuid);
|
final isSpaceSelected = selectedSpacesIds.contains(space.uuid);
|
||||||
|
|
||||||
if (selectedSpacesIds.isEmpty) {
|
if (selectedSpacesIds.isEmpty) {
|
||||||
spaceTreeBloc.add(OnCommunitySelected(community.uuid, [space]));
|
spaceTreeBloc.add(OnSpaceSelected(community, space.uuid ?? '', []));
|
||||||
} else if (isSpaceSelected) {
|
} else if (isSpaceSelected) {
|
||||||
spaceTreeBloc.add(const SpaceTreeClearSelectionEvent());
|
spaceTreeBloc.add(const SpaceTreeClearSelectionEvent());
|
||||||
} else {
|
} else {
|
||||||
|
@ -14,23 +14,7 @@ class OccupancyDataLoadingStrategy implements AnalyticsDataLoadingStrategy {
|
|||||||
CommunityModel community,
|
CommunityModel community,
|
||||||
List<SpaceModel> spaces,
|
List<SpaceModel> spaces,
|
||||||
) {
|
) {
|
||||||
context.read<SpaceTreeBloc>().add(
|
// Do nothing
|
||||||
OnCommunitySelected(
|
|
||||||
community.uuid,
|
|
||||||
spaces.isNotEmpty ? [spaces.first] : [],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
final spaceTreeState = context.read<SpaceTreeBloc>().state;
|
|
||||||
if (spaceTreeState.selectedCommunities.contains(community.uuid)) {
|
|
||||||
clearData(context);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
FetchOccupancyDataHelper.loadOccupancyData(
|
|
||||||
context,
|
|
||||||
communityId: community.uuid,
|
|
||||||
spaceId: spaces.isNotEmpty ? spaces.first.uuid ?? '' : '',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -44,7 +28,7 @@ class OccupancyDataLoadingStrategy implements AnalyticsDataLoadingStrategy {
|
|||||||
final isSpaceSelected = selectedSpacesIds.contains(space.uuid);
|
final isSpaceSelected = selectedSpacesIds.contains(space.uuid);
|
||||||
|
|
||||||
if (selectedSpacesIds.isEmpty) {
|
if (selectedSpacesIds.isEmpty) {
|
||||||
spaceTreeBloc.add(OnCommunitySelected(community.uuid, [space]));
|
spaceTreeBloc.add(OnSpaceSelected(community, space.uuid ?? '', []));
|
||||||
} else if (isSpaceSelected) {
|
} else if (isSpaceSelected) {
|
||||||
spaceTreeBloc.add(const SpaceTreeClearSelectionEvent());
|
spaceTreeBloc.add(const SpaceTreeClearSelectionEvent());
|
||||||
} else {
|
} else {
|
||||||
@ -73,7 +57,7 @@ class OccupancyDataLoadingStrategy implements AnalyticsDataLoadingStrategy {
|
|||||||
CommunityModel community,
|
CommunityModel community,
|
||||||
SpaceModel child,
|
SpaceModel child,
|
||||||
) {
|
) {
|
||||||
// Do nothing
|
if (child.children.isNotEmpty) return onSpaceSelected(context, community, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Reference in New Issue
Block a user