From 1ab7559234107c2ea49ce5e2148a731a1d2a1597 Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 13 Oct 2020 11:09:42 -0400 Subject: fixed runtime errors in presBox --- src/client/views/nodes/PresBox.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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 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 = () => { -- cgit v1.2.3-70-g09d2