diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 8142b2a1b..a58f38ae3 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -601,9 +601,8 @@ export namespace DocUtils { if (sv && sv.props.ContainingCollectionView && sv.props.ContainingCollectionView.props.Document === target) return; if (target === CurrentUserUtils.UserDocument) return undefined; - let linkDoc: Doc | undefined; + let linkDocProto = new Doc(); UndoManager.RunInBatch(() => { - let linkDocProto = new Doc(); linkDocProto.type = DocumentType.LINK; linkDocProto.targetContext = targetContext; @@ -627,7 +626,7 @@ export namespace DocUtils { computed.compiled && (Doc.GetProto(source).links = new ComputedField(computed)); computed.compiled && (Doc.GetProto(target).links = new ComputedField(computed)); }, "make link"); - return linkDoc; + return linkDocProto; } } |