aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/CurrentUserUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-09 11:36:56 -0400
committerbobzel <zzzman@gmail.com>2020-10-09 11:36:56 -0400
commitc8e8cbe52a97835342c3a3d04033462f4497cd72 (patch)
tree009b1a3d779fe9cd2eb33f38e35ed60ab5ab4473 /src/client/util/CurrentUserUtils.ts
parentd4e967ed8fc2f99d44b887ebabf0a4eb642ecaab (diff)
trying to get group updates to work automatically
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
-rw-r--r--src/client/util/CurrentUserUtils.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index d011d7b09..b4e24f70e 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -30,7 +30,7 @@ import { Scripting } from "./Scripting";
import { SearchUtil } from "./SearchUtil";
import { SelectionManager } from "./SelectionManager";
import { UndoManager } from "./UndoManager";
-import { SharingPermissions } from "../../fields/util";
+import { SharingPermissions, UserGroups } from "../../fields/util";
import { Networking } from "../Network";
@@ -988,9 +988,10 @@ export class CurrentUserUtils {
this.setupDockedButtons(doc); // the bottom bar of font icons
await this.setupSidebarButtons(doc); // the pop-out left sidebar of tools/panels
await this.setupMenuPanel(doc, sharingDocumentId);
- doc.globalScriptDatabase = Docs.Prototypes.MainScriptDocument();
- doc.globalGroupDatabase = Docs.Prototypes.MainGroupDocument();
+ if (!doc.globalScriptDatabase) doc.globalScriptDatabase = Docs.Prototypes.MainScriptDocument();
+ if (!doc.globalGroupDatabase) doc.globalGroupDatabase = Docs.Prototypes.MainGroupDocument();
if (!doc.myLinkDatabase) doc.myLinkDatabase = new List([]);
+ UserGroups.setCurrentUserGroups((doc.globalGroupDatabase as Doc).data as List<Doc>);
setTimeout(() => this.setupDefaultPresentation(doc), 0); // presentation that's initially triggered