mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: insert row index
This commit is contained in:
parent
8a7c3a9cfc
commit
b9135d26a9
@ -213,7 +213,8 @@ class _GridRowsState extends State<_GridRows> {
|
||||
key: _key,
|
||||
initialItemCount: context.read<GridBloc>().state.rows.length,
|
||||
itemBuilder: (BuildContext context, int index, Animation<double> animation) {
|
||||
return _renderRow(context, state.rows[index], animation);
|
||||
final rowData = context.read<GridBloc>().state.rows[index];
|
||||
return _renderRow(context, rowData, animation);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
@ -210,7 +210,6 @@ class FlowyOverlayState extends State<FlowyOverlay> {
|
||||
_overlayList.remove(firstItem);
|
||||
if (firstItem.delegate != null) {
|
||||
firstItem.delegate!.didRemove();
|
||||
|
||||
if (firstItem.delegate!.asBarrier()) {
|
||||
return;
|
||||
}
|
||||
|
@ -61,6 +61,10 @@ impl ClientGridBlockMetaEditor {
|
||||
|
||||
let change = block_pad.add_row_meta(row, start_row_id)?;
|
||||
row_count = block_pad.number_of_rows();
|
||||
|
||||
if row_index.is_none() {
|
||||
row_index = Some(row_count - 1);
|
||||
}
|
||||
Ok(change)
|
||||
})
|
||||
.await?;
|
||||
|
@ -92,8 +92,11 @@ impl GridBlockMetaEditorManager {
|
||||
let mut row_count = 0;
|
||||
for row in row_metas {
|
||||
let _ = self.persistence.insert_or_update(&row.block_id, &row.id)?;
|
||||
inserted_row_orders.push(IndexRowOrder::from(&row));
|
||||
row_count = editor.create_row(row, None).await?.0;
|
||||
let mut row_order = IndexRowOrder::from(&row);
|
||||
let (count, index) = editor.create_row(row, None).await?;
|
||||
row_count = count;
|
||||
row_order.index = index;
|
||||
inserted_row_orders.push(row_order);
|
||||
}
|
||||
changesets.push(GridBlockMetaChangeset::from_row_count(&block_id, row_count));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user