Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: update the group when the corresponding field changed
appflowyd1f80b15a046
diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_view_editor.rs b/frontend/rust-lib/flowy-grid/src/services/grid_view_editor.rsindex 0889aec43e..c7736c6fdc 100644--- a/frontend/rust-lib/flowy-grid/src/services/grid_view_editor.rs+++ b/frontend/rust-lib/flowy-grid/src/services/grid_view_editor.rs@@ -201,6 +201,10 @@ impl GridViewRevisionEditor {Ok(())}+ pub(crate) async fn group_id(&self) -> String {+ self.group_controller.read().await.field_id().to_owned()+ }+pub(crate) async fn get_setting(&self) -> GridSettingPB {let field_revs = self.field_delegate.get_field_revs().await;let grid_setting = make_grid_setting(&*self.pad.read().await, &field_revs);diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs b/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rsindex d548cbc9cb..98b8ee51b9 100644--- a/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs+++ b/frontend/rust-lib/flowy-grid/src/services/grid_view_manager.rs@@ -178,12 +178,16 @@ impl GridViewManager {#[tracing::instrument(level = "trace", skip(self), err)]pub(crate) async fn did_update_field(&self, field_id: &str, is_type_option_changed: bool) -> FlowyResult<()> {let view_editor = self.get_default_view_editor().await?;+ // Only the field_id of the updated field is equal to the field_id of the group.+ // Update the group+ if view_editor.group_id().await != field_id {+ return Ok(());+ }if is_type_option_changed {let _ = view_editor.group_by_field(field_id).await?;} else {let _ = view_editor.did_update_field(field_id).await?;}-Ok(())}