aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-10-13 23:16:02 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-10-13 23:16:02 +0800
commit9a6610b22bb33eb27ad0bc9ad921e148ffa2af42 (patch)
tree7a602ded78e24a96215a1a131ce58e3ca62e59b2
parentf38686582cb17c40223174452a08f8ffa576e9b5 (diff)
parent1ab7559234107c2ea49ce5e2148a731a1d2a1597 (diff)
Merge branch 'master' into presentation_v1
-rw-r--r--src/client/views/nodes/PresBox.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index 9f71611a1..1a16e6237 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -121,10 +121,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
this.layoutDoc._gridGap = 0;
this.layoutDoc._yMargin = 0;
this.turnOffEdit(true);
- DocListCastAsync((Doc.UserDoc().myPresentations as Doc).data).then(async pres => {
- await Promise.all(pres!);
- if (!DocListCast((Doc.UserDoc().myPresentations as Doc).data).includes(this.rootDoc)) Doc.AddDocToList(Doc.UserDoc().myPresentations as Doc, "data", this.rootDoc);
- });
+ DocListCastAsync((Doc.UserDoc().myPresentations as Doc).data).then(pres =>
+ !pres?.includes(this.rootDoc) && Doc.AddDocToList(Doc.UserDoc().myPresentations as Doc, "data", this.rootDoc));
}
updateCurrentPresentation = () => {