diff options
author | Jenny Yu <jennyyu212@outlook.com> | 2022-06-09 21:21:25 -0700 |
---|---|---|
committer | Jenny Yu <jennyyu212@outlook.com> | 2022-06-09 21:21:25 -0700 |
commit | 9bae71b77847d6823e08e5143d04816f31d3b267 (patch) | |
tree | 5b32d7c3f67b8d81e53d8bbd2a0cdc83e98048d8 /src/client/util/CurrentUserUtils.ts | |
parent | 46de0c33f92660266c4e72161e7f4d2f9d8439d1 (diff) | |
parent | f550bca52735d9bd2195ff453e43beca18bef309 (diff) |
Merge branch 'mainview-jenny' of https://github.com/brown-dash/Dash-Web into mainview-jenny
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
-rw-r--r-- | src/client/util/CurrentUserUtils.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index d32f1bf70..e46bb3b3e 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -931,7 +931,6 @@ export class CurrentUserUtils { sharedDocs.childContextMenuScripts = new List<ScriptField>([addToDashboards!,]); sharedDocs.childContextMenuLabels = new List<string>(["Add to Dashboards",]); sharedDocs.childContextMenuIcons = new List<string>(["user-plus",]); - } doc.mySharedDocs = new PrefetchProxy(sharedDocs as Doc); } @@ -1111,6 +1110,9 @@ export class CurrentUserUtils { public static openDashboard = (userDoc: Doc, doc: Doc, fromHistory = false) => { CurrentUserUtils.MainDocId = doc[Id]; + if (!DocListCast(CurrentUserUtils.MyDashboards.data).includes(doc)) { + Doc.AddDocToList(CurrentUserUtils.MyDashboards, "data", doc); + } if (doc) { // this has the side-effect of setting the main container since we're assigning the active/guest dashboard !("presentationView" in doc) && (doc.presentationView = new List<Doc>([Docs.Create.TreeDocument([], { title: "Presentation" })])); @@ -1194,7 +1196,7 @@ export class CurrentUserUtils { docView.layoutDoc[Id] + "-icon" + (new Date()).getTime(), content, _width, _height, - _width, _height, 0, + _width, _height, 0, 1, true, docView.layoutDoc[Id] + "-icon", (iconFile, _nativeWidth, _nativeHeight) => { const img = Docs.Create.ImageDocument(new ImageField(iconFile), { title: docView.rootDoc.title+"-icon", _width, _height, _nativeWidth, _nativeHeight}); const proto = Cast(img.proto, Doc, null)!; |