From d123cac247bcc37aa00fe44a4933df86b71e93af Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sat, 10 Oct 2020 17:49:41 -0400
Subject: split LinkDatbase into its own field in the user's registry.  fixed
 sharing to set lastModified after modifying groups so that remote
 participants see the right data.  fixed text boxes to show blue icon when
 there's an annotaitn entry

---
 src/client/util/SharingManager.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'src/client/util/SharingManager.tsx')

diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx
index 16bcd46c8..271face98 100644
--- a/src/client/util/SharingManager.tsx
+++ b/src/client/util/SharingManager.tsx
@@ -22,11 +22,11 @@ import "./SharingManager.scss";
 import { SelectionManager } from "./SelectionManager";
 import { intersection } from "lodash";
 import { SearchBox } from "../views/search/SearchBox";
-import { listSpec } from "../../fields/Schema";
 
 export interface User {
     email: string;
     sharingDocumentId: string;
+    linkDatabaseId: string;
 }
 
 /**
@@ -53,6 +53,7 @@ const storage = "data";
 interface ValidatedUser {
     user: User;         // database minimal info to identify / communicate with a user (email, sharing doc id)
     sharingDoc: Doc;    // document to share/message another user
+    linkDatabase: Doc;
     userColor: string;  // stored on the sharinDoc, extracted for convenience?
 }
 
@@ -130,8 +131,10 @@ export class SharingManager extends React.Component<{}> {
                 const isCandidate = user.email !== Doc.CurrentUserEmail;
                 if (isCandidate) {
                     const sharingDoc = await DocServer.GetRefField(user.sharingDocumentId);
-                    if (sharingDoc instanceof Doc) {
-                        sharingDocs.push({ user, sharingDoc, userColor: StrCast(sharingDoc.color) });
+                    const linkDatabase = await DocServer.GetRefField(user.linkDatabaseId);
+                    if (sharingDoc instanceof Doc && linkDatabase instanceof Doc) {
+                        await DocListCastAsync(linkDatabase.data);
+                        sharingDocs.push({ user, sharingDoc, linkDatabase, userColor: StrCast(sharingDoc.color) });
                     }
                 }
             });
-- 
cgit v1.2.3-70-g09d2

