mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
SP-1591
This commit is contained in:
@ -24,26 +24,17 @@ final class AirQualityDataLoadingStrategy implements AnalyticsDataLoadingStrateg
|
||||
SpaceModel space,
|
||||
) {
|
||||
final spaceTreeBloc = context.read<SpaceTreeBloc>();
|
||||
final selectedSpacesIds = spaceTreeBloc.state.selectedSpaces;
|
||||
final isSpaceSelected = selectedSpacesIds.contains(space.uuid);
|
||||
final isSpaceSelected = spaceTreeBloc.state.selectedSpaces.contains(space.uuid);
|
||||
|
||||
if (selectedSpacesIds.isEmpty) {
|
||||
spaceTreeBloc.add(OnSpaceSelected(community, space.uuid ?? '', []));
|
||||
} else if (isSpaceSelected) {
|
||||
spaceTreeBloc.add(const SpaceTreeClearSelectionEvent());
|
||||
} else {
|
||||
spaceTreeBloc
|
||||
..add(const SpaceTreeClearSelectionEvent())
|
||||
..add(OnSpaceSelected(community, space.uuid ?? '', []));
|
||||
}
|
||||
|
||||
final spaceTreeState = context.read<SpaceTreeBloc>().state;
|
||||
if (spaceTreeState.selectedCommunities.contains(community.uuid) ||
|
||||
spaceTreeState.selectedSpaces.contains(space.uuid)) {
|
||||
if (isSpaceSelected) {
|
||||
clearData(context);
|
||||
return;
|
||||
}
|
||||
|
||||
spaceTreeBloc
|
||||
..add(const SpaceTreeClearSelectionEvent())
|
||||
..add(OnSpaceSelected(community, space.uuid ?? '', []));
|
||||
|
||||
FetchAirQualityDataHelper.loadAirQualityData(
|
||||
context,
|
||||
communityUuid: community.uuid,
|
||||
|
Reference in New Issue
Block a user