Преглед на файлове

feat: support DidUpdateChildViews callback

Lucas.Xu преди 2 години
родител
ревизия
9863000f4a
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      frontend/appflowy_flutter/lib/workspace/application/view/view_bloc.dart

+ 9 - 0
frontend/appflowy_flutter/lib/workspace/application/view/view_bloc.dart

@@ -30,6 +30,15 @@ class ViewBloc extends Bloc<ViewEvent, ViewState> {
             onViewUpdated: (result) {
               add(ViewEvent.viewDidUpdate(left(result)));
             },
+            onViewChildViewsUpdated: (result) async {
+              final view = await ViewBackendService.getView(
+                result.parentViewId,
+              );
+              view.fold(
+                (view) => add(ViewEvent.viewDidUpdate(left(view))),
+                (error) => add(ViewEvent.viewDidUpdate(right(error))),
+              );
+            },
           );
           final isExpanded = await _getViewIsExpanded(view);
           await _loadViewsWhenExpanded(emit, isExpanded);