aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2020-07-24 14:04:25 +0800
committergeireann <60007097+geireann@users.noreply.github.com>2020-07-24 14:04:25 +0800
commit3b5f5875929c2b033dd536c7838606cb91c01a1a (patch)
tree9e24b1cef79d1e60aa7f39a430afbe6bc804d660 /src/client/views/GlobalKeyHandler.ts
parent0bdbf8bfbd4c2c2e8e7c1f4e7d530c628ad5e398 (diff)
parentf68b3da6c4d01bf9627723d58a6ce006e360ea30 (diff)
Merge branch 'master' into presentation_updates
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index 4dfa7aec8..086085db5 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -309,13 +309,13 @@ export default class KeyManager {
const targetDataDoc = Doc.GetProto(first.props.Document);
const fieldKey = Doc.LayoutFieldKey(first.props.Document);
const docList = DocListCast(targetDataDoc[fieldKey]);
- docids.map((did, i) => i && DocServer.GetRefField(did).then(doc => {
+ docids.map((did, i) => i && DocServer.GetRefField(did).then(async doc => {
count++;
if (doc instanceof Doc) {
list.push(doc);
}
if (count === docids.length) {
- const added = list.filter(d => !docList.includes(d)).map(d => clone ? Doc.MakeClone(d) : d);
+ const added = await Promise.all(list.filter(d => !docList.includes(d)).map(async d => clone ? (await Doc.MakeClone(d)).clone : d));
if (added.length) {
added.map(doc => doc.context = targetDataDoc);
undoBatch(() => {