From 6503f182a4534119a9ae27a9decf884db70775c3 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 13 Jul 2023 21:05:23 -0400 Subject: from last - fixed one problem with group sharing, others exist (remove/adding meber from group after sharing has been done doesn't take effect until browser refresh) --- src/client/util/CurrentUserUtils.ts | 2 +- src/client/util/SharingManager.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 7832b1c87..7d0b477e2 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -783,7 +783,6 @@ export class CurrentUserUtils { const sharedDocOpts:DocumentOptions = { title: "My Shared Docs", userColor: "rgb(202, 202, 202)", - data_dashboards: new List(), isFolder:true, undoIgnoreFields:new List(['treeViewSortCriterion']), // childContextMenuFilters: new List([dashboardFilter!,]), // childContextMenuScripts: new List([addToDashboards!,]), @@ -797,6 +796,7 @@ export class CurrentUserUtils { }; DocUtils.AssignDocField(doc, "mySharedDocs", opts => Docs.Create.TreeDocument([], opts, sharingDocumentId + "layout", sharingDocumentId), sharedDocOpts, undefined, sharedScripts); + if (!DocCast(doc.mySharedDocs).data_dashboards) DocCast(doc.mySharedDocs).data_dashboards = new List(); } /// Import option on the left side button panel diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index 587e1e585..8e5ae7bc0 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -251,7 +251,7 @@ export class SharingManager extends React.Component<{}> { removeMember = (group: Doc, emailId: string) => { const user: ValidatedUser = this.users.find(({ user: { email } }) => email === emailId)!; - if (group.docsShared) { + if (group.docsShared && user) { DocListCastAsync(user.sharingDoc[storage]).then(userdocs => DocListCastAsync(group.docsShared).then(dl => { const remaining = userdocs?.filter(doc => !dl?.includes(doc)) || []; -- cgit v1.2.3-70-g09d2