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