fix: blockService exception

This commit is contained in:
appflowy 2022-04-08 15:13:53 +08:00
parent 814fdfe8e9
commit 1f657f3bf8
2 changed files with 9 additions and 12 deletions

View file

@ -365,11 +365,8 @@ impl ClientGridEditor {
F: for<'a> FnOnce(&'a mut GridMetaPad) -> FlowyResult<Option<GridChangeset>>,
{
let mut write_guard = self.pad.write().await;
match f(&mut *write_guard)? {
None => {}
Some(change) => {
let _ = self.apply_change(change).await?;
}
if let Some(changeset) = f(&mut *write_guard)? {
let _ = self.apply_change(changeset).await?;
}
Ok(())
}