From 845397e81981d41314d45a7e302e9e5d6e42f122 Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Wed, 23 Jul 2025 13:21:49 +0300 Subject: [PATCH] Update `CommunityStructureCanvas` to improve widget update logic by animating to the selected space based on community UUID changes. This enhances the responsiveness of the UI when the community context changes. --- .../main_module/widgets/community_structure_canvas.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/space_management_v2/main_module/widgets/community_structure_canvas.dart b/lib/pages/space_management_v2/main_module/widgets/community_structure_canvas.dart index 6614aa88..9e161f55 100644 --- a/lib/pages/space_management_v2/main_module/widgets/community_structure_canvas.dart +++ b/lib/pages/space_management_v2/main_module/widgets/community_structure_canvas.dart @@ -56,8 +56,9 @@ class _CommunityStructureCanvasState extends State @override void didUpdateWidget(covariant CommunityStructureCanvas oldWidget) { super.didUpdateWidget(oldWidget); - if (widget.selectedSpace == null) return; - if (widget.selectedSpace?.uuid != oldWidget.selectedSpace?.uuid) { + if (oldWidget.community.uuid != widget.community.uuid) { + _animateToSpace(null); + } else if (widget.selectedSpace?.uuid != oldWidget.selectedSpace?.uuid) { WidgetsBinding.instance.addPostFrameCallback((_) { if (mounted) { _animateToSpace(widget.selectedSpace);