mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
fix getstarted
This commit is contained in:
parent
d7da0087d9
commit
79f47f6b9e
1 changed files with 15 additions and 0 deletions
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/anytypeio/go-anytype-middleware/core/block/object"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple/bookmark"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple/dataview"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple/link"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple/relation"
|
||||
"github.com/anytypeio/go-anytype-middleware/core/block/simple/text"
|
||||
|
@ -188,6 +189,20 @@ func (b *builtinObjects) createObject(ctx context.Context, rd io.ReadCloser) (er
|
|||
|
||||
st.Iterate(func(bl simple.Block) (isContinue bool) {
|
||||
switch a := bl.(type) {
|
||||
case dataview.Block:
|
||||
target := a.Model().GetDataview().TargetObjectId
|
||||
if target == "" {
|
||||
return true
|
||||
}
|
||||
newTarget := b.idsMap[target]
|
||||
if newTarget == "" {
|
||||
// maybe we should panic here?
|
||||
log.With("object", st.RootId()).Errorf("cant find target id for dataview: %s", a.Model().GetDataview().TargetObjectId)
|
||||
return true
|
||||
}
|
||||
|
||||
a.Model().GetDataview().TargetObjectId = newTarget
|
||||
st.Set(simple.New(a.Model()))
|
||||
case link.Block:
|
||||
newTarget := b.idsMap[a.Model().GetLink().TargetBlockId]
|
||||
if newTarget == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue