diff options
-rw-r--r-- | src/client/views/collections/CollectionFreeFormView.tsx | 5 | ||||
-rw-r--r-- | src/client/views/collections/CollectionViewBase.tsx | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx index 4a82bdb77..e095f0252 100644 --- a/src/client/views/collections/CollectionFreeFormView.tsx +++ b/src/client/views/collections/CollectionFreeFormView.tsx @@ -376,7 +376,8 @@ export class CollectionFreeFormView extends CollectionViewBase { {this.views} {super.getCursors().map(entry => { if (entry.Data.length > 0) { - let id = entry.Data[0]; + let id = entry.Data[0][0]; + let email = entry.Data[0][1]; let point = entry.Data[1]; this.drawCrosshairs("#" + v5(id, v5.URL).substring(0, 6).toUpperCase() + "22") return ( @@ -410,7 +411,7 @@ export class CollectionFreeFormView extends CollectionViewBase { marginLeft: -12, marginTop: 4 }} - >{CurrentUserUtils.email[0].toUpperCase()}</p> + >{email[0].toUpperCase()}</p> </div> ); } diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx index 9b5c88d14..c3f7e4951 100644 --- a/src/client/views/collections/CollectionViewBase.tsx +++ b/src/client/views/collections/CollectionViewBase.tsx @@ -36,7 +36,7 @@ export interface SubCollectionViewProps extends CollectionViewProps { CollectionView: CollectionView; } -export type CursorEntry = TupleField<string, [number, number]>; +export type CursorEntry = TupleField<[string, string], [number, number]>; export class CollectionViewBase extends React.Component<SubCollectionViewProps> { private dropDisposer?: DragManager.DragDropDisposer; @@ -54,13 +54,15 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps> let ind; let doc = this.props.Document; let id = CurrentUserUtils.id; - if (id) { + let email = CurrentUserUtils.email; + if (id && email) { + let textInfo: [string, string] = [id, email]; doc.GetOrCreateAsync<ListField<CursorEntry>>(KeyStore.Cursors, ListField, field => { let cursors = field.Data; - if (cursors.length > 0 && (ind = cursors.findIndex(entry => entry.Data[0] === id)) > -1) { + if (cursors.length > 0 && (ind = cursors.findIndex(entry => entry.Data[0][0] === id)) > -1) { cursors[ind].Data[1] = position; } else { - let entry = new TupleField<string, [number, number]>([id, position]); + let entry = new TupleField<[string, string], [number, number]>([textInfo, position]); cursors.push(entry); } }) @@ -73,7 +75,7 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps> let doc = this.props.Document; let id = CurrentUserUtils.id; let cursors = doc.GetList<CursorEntry>(KeyStore.Cursors, []); - let notMe = cursors.filter(entry => entry.Data[0] !== id); + let notMe = cursors.filter(entry => entry.Data[0][0] !== id); return id ? notMe : []; } |