aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/linking
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/linking')
-rw-r--r--src/client/views/linking/LinkFollowBox.tsx5
-rw-r--r--src/client/views/linking/LinkMenuItem.tsx7
2 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/linking/LinkFollowBox.tsx b/src/client/views/linking/LinkFollowBox.tsx
index 54670e2c7..07f07f72a 100644
--- a/src/client/views/linking/LinkFollowBox.tsx
+++ b/src/client/views/linking/LinkFollowBox.tsx
@@ -38,7 +38,7 @@ enum FollowOptions {
export class LinkFollowBox extends React.Component<FieldViewProps> {
public static LayoutString() { return FieldView.LayoutString(LinkFollowBox); }
- public static Instance: LinkFollowBox;
+ public static Instance: LinkFollowBox | undefined;
@observable static linkDoc: Doc | undefined = undefined;
@observable static destinationDoc: Doc | undefined = undefined;
@observable static sourceDoc: Doc | undefined = undefined;
@@ -557,7 +557,8 @@ export class LinkFollowBox extends React.Component<FieldViewProps> {
async close() {
let res = await DocListCastAsync((CurrentUserUtils.UserDocument.overlays as Doc).data);
- if (res) res.splice(res.indexOf(LinkFollowBox.Instance.props.Document), 1);
+ if (res) res.splice(res.indexOf(LinkFollowBox.Instance!.props.Document), 1);
+ LinkFollowBox.Instance = undefined;
}
render() {
diff --git a/src/client/views/linking/LinkMenuItem.tsx b/src/client/views/linking/LinkMenuItem.tsx
index 0ae578d5a..6c10d4fb6 100644
--- a/src/client/views/linking/LinkMenuItem.tsx
+++ b/src/client/views/linking/LinkMenuItem.tsx
@@ -100,9 +100,10 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
if (LinkFollowBox.Instance === undefined) {
let doc = await Docs.Create.LinkFollowBoxDocument({ x: MainView.Instance.flyoutWidth, y: 20, width: 500, height: 370, title: "Link Follower" });
await Doc.AddDocToList(Cast(CurrentUserUtils.UserDocument.overlays, Doc) as Doc, "data", doc);
+ } else {
+ LinkFollowBox.Instance!.setLinkDocs(this.props.linkDoc, this.props.sourceDoc, this.props.destinationDoc);
+ LinkFollowBox.Instance!.defaultLinkBehavior();
}
- LinkFollowBox.Instance.setLinkDocs(this.props.linkDoc, this.props.sourceDoc, this.props.destinationDoc);
- LinkFollowBox.Instance.defaultLinkBehavior();
}
@action.bound
@@ -113,7 +114,7 @@ export class LinkMenuItem extends React.Component<LinkMenuItemProps> {
} else {
MainView.Instance.toggleLinkFollowBox(false);
}
- LinkFollowBox.Instance.setLinkDocs(this.props.linkDoc, this.props.sourceDoc, this.props.destinationDoc);
+ LinkFollowBox.Instance!.setLinkDocs(this.props.linkDoc, this.props.sourceDoc, this.props.destinationDoc);
}
render() {