mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
update space bloc on community and space change
This commit is contained in:
@ -139,7 +139,6 @@ class SpaceManagementBloc
|
||||
UpdateCommunityEvent event,
|
||||
Emitter<SpaceManagementState> emit,
|
||||
) async {
|
||||
|
||||
final previousState = state;
|
||||
try {
|
||||
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
|
||||
@ -154,6 +153,8 @@ class SpaceManagementBloc
|
||||
for (var community in updatedCommunities) {
|
||||
if (community.uuid == event.communityUuid) {
|
||||
community.name = event.name;
|
||||
_spaceTreeBloc.add(OnCommunityAdded(community));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -456,8 +457,6 @@ class SpaceManagementBloc
|
||||
event.communityUuid,
|
||||
emit,
|
||||
);
|
||||
} else {
|
||||
// add(LoadCommunityAndSpacesEvent());
|
||||
}
|
||||
} catch (e) {
|
||||
emit(SpaceManagementError('Error saving spaces: $e'));
|
||||
@ -481,6 +480,8 @@ class SpaceManagementBloc
|
||||
for (var community in communities) {
|
||||
if (community.uuid == communityUuid) {
|
||||
community.spaces = allSpaces;
|
||||
_spaceTreeBloc.add(OnCommunityUpdated(community));
|
||||
|
||||
emit(SpaceManagementLoaded(
|
||||
communities: communities,
|
||||
products: _cachedProducts ?? [],
|
||||
|
Reference in New Issue
Block a user