mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: FieldEditor not refresh its type-option data after switching to a new field (#1285)
Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -31,11 +31,13 @@ impl TypeOptionBuilder for RichTextTypeOptionBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
/// For the moment, the `RichTextTypeOptionPB` is empty. The `data` property is not
|
||||
/// used yet.
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, ProtoBuf)]
|
||||
pub struct RichTextTypeOptionPB {
|
||||
#[pb(index = 1)]
|
||||
#[serde(default)]
|
||||
data: String, //It's not used yet
|
||||
data: String,
|
||||
}
|
||||
impl_type_option!(RichTextTypeOptionPB, FieldType::RichText);
|
||||
|
||||
|
@ -100,15 +100,15 @@ impl GridRevisionEditor {
|
||||
///
|
||||
/// * `grid_id`: the id of the grid
|
||||
/// * `field_id`: the id of the field
|
||||
/// * `type_option_data`: the updated type-option data.
|
||||
///
|
||||
/// * `type_option_data`: the updated type-option data. The `type-option` data might be empty
|
||||
/// if there is no type-option config for that field. For example, the `RichTextTypeOptionPB`.
|
||||
///
|
||||
pub async fn update_field_type_option(
|
||||
&self,
|
||||
grid_id: &str,
|
||||
field_id: &str,
|
||||
type_option_data: Vec<u8>,
|
||||
) -> FlowyResult<()> {
|
||||
debug_assert!(!type_option_data.is_empty());
|
||||
if type_option_data.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
Reference in New Issue
Block a user