mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 09:35:00 +09:00
GO-1367: fix
This commit is contained in:
parent
47697b8860
commit
2b7d616633
1 changed files with 10 additions and 4 deletions
|
@ -424,12 +424,18 @@ func (p *Pb) getIDForSubObject(sn *pb.SnapshotWithType, id string) string {
|
|||
|
||||
// cleanupEmptyBlockMigration is fixing existing pages, imported from Notion
|
||||
func (p *Pb) cleanupEmptyBlock(snapshot *pb.SnapshotWithType) {
|
||||
var (
|
||||
emptyBlock *model.Block
|
||||
)
|
||||
|
||||
for _, block := range snapshot.Snapshot.Data.Blocks {
|
||||
if block.Content == nil {
|
||||
block.Content = &model.BlockContentOfSmartblock{
|
||||
Smartblock: &model.BlockContentSmartblock{},
|
||||
}
|
||||
break
|
||||
emptyBlock = block
|
||||
} else if block.GetSmartblock() != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
if emptyBlock != nil {
|
||||
emptyBlock.Content = &model.BlockContentOfSmartblock{Smartblock: &model.BlockContentSmartblock{}}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue