From c827f9b15645d6790e4befbe449434760301a882 Mon Sep 17 00:00:00 2001 From: appflowy Date: Thu, 25 Aug 2022 12:36:56 +0800 Subject: [PATCH] chore: fix card refresh issue --- .../app_flowy/lib/plugins/board/application/board_bloc.dart | 5 +---- .../application/card/board_select_option_cell_bloc.dart | 1 - .../grid/application/cell/cell_service/context_builder.dart | 5 ++++- frontend/rust-lib/flowy-grid/src/event_handler.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart index 422f1dff2b..7c04dec814 100644 --- a/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/board_bloc.dart @@ -317,9 +317,6 @@ class GroupControllerDelegateImpl extends GroupControllerDelegate { @override void updateRow(String groupId, RowPB row) { - // workaround: fix the board card reload timing issue. - Future.delayed(const Duration(milliseconds: 300), () { - controller.updateColumnItem(groupId, BoardColumnItem(row: row)); - }); + controller.updateColumnItem(groupId, BoardColumnItem(row: row)); } } diff --git a/frontend/app_flowy/lib/plugins/board/application/card/board_select_option_cell_bloc.dart b/frontend/app_flowy/lib/plugins/board/application/card/board_select_option_cell_bloc.dart index df36033cfa..1b70710a35 100644 --- a/frontend/app_flowy/lib/plugins/board/application/card/board_select_option_cell_bloc.dart +++ b/frontend/app_flowy/lib/plugins/board/application/card/board_select_option_cell_bloc.dart @@ -68,7 +68,6 @@ class BoardSelectOptionCellState with _$BoardSelectOptionCellState { factory BoardSelectOptionCellState.initial( GridSelectOptionCellController context) { final data = context.getCellData(); - return BoardSelectOptionCellState( selectedOptions: data?.selectOptions ?? [], ); diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart index 95c708e0e2..8ab486a48c 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart @@ -190,7 +190,10 @@ class IGridCellController extends Equatable { /// cell display: $12 _cellListener?.start(onCellChanged: (result) { result.fold( - (_) => _loadData(), + (_) { + _cellsCache.remove(fieldId); + _loadData(); + }, (err) => Log.error(err), ); }); diff --git a/frontend/rust-lib/flowy-grid/src/event_handler.rs b/frontend/rust-lib/flowy-grid/src/event_handler.rs index a9060aa87e..4b525c233f 100644 --- a/frontend/rust-lib/flowy-grid/src/event_handler.rs +++ b/frontend/rust-lib/flowy-grid/src/event_handler.rs @@ -269,7 +269,7 @@ pub(crate) async fn create_table_row_handler( data_result(row) } -// #[tracing::instrument(level = "debug", skip_all, err)] +#[tracing::instrument(level = "trace", skip_all, err)] pub(crate) async fn get_cell_handler( data: Data, manager: AppData>,