diff options
author | kimdahey <claire_kim1@brown.edu> | 2019-09-12 16:03:18 -0400 |
---|---|---|
committer | kimdahey <claire_kim1@brown.edu> | 2019-09-12 16:03:18 -0400 |
commit | d6a31b7c55f91336b94dce59096da1bb2dc01d88 (patch) | |
tree | 8f6a67b1bddbb25a69ced6056392c3fb4026231b /src | |
parent | bbdd26d89a231922cebd1560761ffffba97b9a40 (diff) |
will check guid statuses
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/linking/LinkFollowBox.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/linking/LinkFollowBox.tsx b/src/client/views/linking/LinkFollowBox.tsx index 603515d2a..2ae5fcda0 100644 --- a/src/client/views/linking/LinkFollowBox.tsx +++ b/src/client/views/linking/LinkFollowBox.tsx @@ -255,15 +255,16 @@ export class LinkFollowBox extends React.Component<FieldViewProps> { } else if (LinkFollowBox.destinationDoc === LinkFollowBox.linkDoc.anchor1 && sourceContext) { DocumentManager.Instance.jumpToDocument(jumpToDoc, shouldZoom, false, document => dockingFunc(sourceContext!)); - if (LinkFollowBox.sourceDoc) { + if (LinkFollowBox.sourceDoc && LinkFollowBox.destinationDoc) { if (guid) { console.log("guid"); - console.log('wegotthis', StrCast(LinkFollowBox.sourceDoc[Id])); // need to find if jumptodoc is the doc to follow, take id + console.log('source and dest ids respectively are', StrCast(LinkFollowBox.sourceDoc[Id]), StrCast(LinkFollowBox.destinationDoc[Id])); // need to find if jumptodoc is the doc to follow, take id jumpToDoc.linkHref = Utils.prepend("/doc/" + StrCast(LinkFollowBox.sourceDoc[Id])); LinkFollowBox.destinationDoc.guid = guid; // process to follow: if guid, then we want to find the linkhref and use that to figure out whether we can find the links that correspond to the guid. } else { console.log("no guid"); // retroactively fixing old in-text links by adding guid + console.log('source and dest ids respectively are', StrCast(LinkFollowBox.sourceDoc[Id]), StrCast(LinkFollowBox.destinationDoc[Id])); jumpToDoc.linkHref = Utils.prepend("/doc/" + StrCast(LinkFollowBox.sourceDoc[Id])); let newguid = Utils.GenerateGuid(); LinkFollowBox.linkDoc.guid = newguid; |