aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-13 11:09:42 -0400
committerbobzel <zzzman@gmail.com>2020-10-13 11:09:42 -0400
commit1ab7559234107c2ea49ce5e2148a731a1d2a1597 (patch)
treeed0e64d9a659e26596585c8af6994d04a2c9228b
parent0d630f812d0924bac0863be62dbd3cdfc2b9e2c1 (diff)
fixed runtime errors in presBox
-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 7eca09f8c..e79b2810b 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -120,10 +120,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps, PresBoxSchema>
this.layoutDoc.presStatus = "edit";
this.layoutDoc._gridGap = 5;
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 = () => {