mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-09 17:44:59 +09:00
GO-2966 Remove invite details from space view
This commit is contained in:
parent
32ed1830c2
commit
8913e06136
1 changed files with 13 additions and 1 deletions
|
@ -212,7 +212,11 @@ func (a *aclService) StopSharing(ctx context.Context, spaceId string) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("%w, %w", ErrAclRequestFailed, err)
|
||||
}
|
||||
return nil
|
||||
spaceViewId, err := a.spaceService.SpaceViewId(spaceId)
|
||||
if err != nil {
|
||||
return fmt.Errorf("get space view id: %w", err)
|
||||
}
|
||||
return a.removeExistingInviteFileInfo(spaceViewId)
|
||||
}
|
||||
|
||||
func (a *aclService) Join(ctx context.Context, spaceId string, inviteCid cid.Cid, inviteFileKey crypto.SymKey) error {
|
||||
|
@ -406,6 +410,14 @@ func (a *aclService) getExistingInviteFileInfo(spaceViewId string) (fileCid stri
|
|||
return
|
||||
}
|
||||
|
||||
func (a *aclService) removeExistingInviteFileInfo(spaceViewId string) (err error) {
|
||||
return getblock.Do(a.objectGetter, spaceViewId, func(sb smartblock.SmartBlock) error {
|
||||
newState := sb.NewState()
|
||||
newState.RemoveDetail(bundle.RelationKeySpaceInviteFileCid.String(), bundle.RelationKeySpaceInviteFileKey.String())
|
||||
return sb.Apply(newState)
|
||||
})
|
||||
}
|
||||
|
||||
func (a *aclService) GetCurrentInvite(spaceId string) (*InviteInfo, error) {
|
||||
spaceViewId, err := a.spaceService.SpaceViewId(spaceId)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue