1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Change tree creation logic

This commit is contained in:
mcrakhman 2022-12-06 10:19:53 +01:00 committed by Mikhail Iudin
parent 86ba8e33d0
commit 9d9867a632
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
5 changed files with 36 additions and 91 deletions

View file

@ -27,22 +27,13 @@ type textDocument struct {
func CreateTextDocument(
ctx context.Context,
space commonspace.Space,
account account.Service,
listener updatelistener.UpdateListener) (doc TextDocument, err error) {
account account.Service) (id string, err error) {
payload := tree.ObjectTreeCreatePayload{
SignKey: account.Account().SignKey,
SpaceId: space.Id(),
Identity: account.Account().Identity,
}
t, err := space.CreateTree(ctx, payload, listener)
if err != nil {
return
}
return &textDocument{
ObjectTree: t,
account: account,
}, nil
return space.CreateTree(ctx, payload)
}
func NewTextDocument(ctx context.Context, space commonspace.Space, id string, listener updatelistener.UpdateListener, account account.Service) (doc TextDocument, err error) {