diff options
author | bobzel <zzzman@gmail.com> | 2023-03-17 09:24:34 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-03-17 09:24:34 -0400 |
commit | 4ecac6f070759e79c254f4a356d02a871ac6abb5 (patch) | |
tree | 08b1a8272096ac3a7ff11cb26d78a72b894bcc33 /src/client/views/PreviewCursor.tsx | |
parent | de0df48cba8e89256a3208fbadfd5afaaa9e22d3 (diff) |
fixed copy paste to clone links if both anchors are copied. adjusted API for clone to have a cloneLinks field.
Diffstat (limited to 'src/client/views/PreviewCursor.tsx')
-rw-r--r-- | src/client/views/PreviewCursor.tsx | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/client/views/PreviewCursor.tsx b/src/client/views/PreviewCursor.tsx index 3712fff58..95ae65d7a 100644 --- a/src/client/views/PreviewCursor.tsx +++ b/src/client/views/PreviewCursor.tsx @@ -81,14 +81,8 @@ export class PreviewCursor extends React.Component<{}> { const batch = UndoManager.StartBatch('cloning'); { - const docs = await Promise.all( - docids - .filter((did, i) => i) - .map(async did => { - const doc = Cast(await DocServer.GetRefField(did), Doc, null); - return clone ? (await Doc.MakeClone(doc)).clone : doc; - }) - ); + const toCopy = await Promise.all(docids.slice(1).map(async did => Cast(await DocServer.GetRefField(did), Doc, null))); + const docs = clone ? (await Promise.all(Doc.MakeClones(toCopy, false))).map(res => res.clone) : toCopy; const firstx = docs.length ? NumCast(docs[0].x) + ptx - newPoint[0] : 0; const firsty = docs.length ? NumCast(docs[0].y) + pty - newPoint[1] : 0; docs.map(doc => { |