1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 09:35:00 +09:00

GO-2166: Fix space creation

This commit is contained in:
Sergey 2023-10-13 11:49:41 +05:00
parent bb52b48715
commit 35db541479
No known key found for this signature in database
GPG key ID: 3B6BEF79160221C6
10 changed files with 90 additions and 91 deletions

View file

@ -9,12 +9,12 @@ import (
"github.com/anyproto/anytype-heart/space/spaceinfo"
)
func (s *service) startLoad(ctx context.Context, spaceID string) (err error) {
func (s *service) startLoad(ctx context.Context, spaceID string, justCreated bool) (err error) {
s.mu.Lock()
defer s.mu.Unlock()
status := s.getStatus(spaceID)
// Do nothing if space is already loading
if status.LocalStatus != spaceinfo.LocalStatusUnknown {
return nil
}
@ -34,7 +34,7 @@ func (s *service) startLoad(ctx context.Context, spaceID string) (err error) {
if err = s.setStatus(ctx, info); err != nil {
return
}
s.loading[spaceID] = newLoadingSpace(s.ctx, spaceID, s)
s.loading[spaceID] = s.newLoadingSpace(s.ctx, spaceID, justCreated)
return
}