aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LinkDocPreview.tsx
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2021-10-14 14:30:47 -0400
committergeireann <geireann.lindfield@gmail.com>2021-10-14 14:30:47 -0400
commit0f83dfd2aa9738509fdb09cd54005d1ccf5c552c (patch)
treea9032715c1ca3b9eb3dadbb17776ed158c30b4a5 /src/client/views/nodes/LinkDocPreview.tsx
parent53019659c2335906ac9e42d755548ea35dfc0365 (diff)
parent662176f25e25d3bf31cfb8ec6e3792d18f77f37d (diff)
Merge branch 'master' into splash-screen-3-Anh-En-Hua
Diffstat (limited to 'src/client/views/nodes/LinkDocPreview.tsx')
-rw-r--r--src/client/views/nodes/LinkDocPreview.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/LinkDocPreview.tsx b/src/client/views/nodes/LinkDocPreview.tsx
index 126a37eb8..424083dac 100644
--- a/src/client/views/nodes/LinkDocPreview.tsx
+++ b/src/client/views/nodes/LinkDocPreview.tsx
@@ -4,7 +4,7 @@ import { action, computed, observable } from 'mobx';
import { observer } from "mobx-react";
import wiki from "wikijs";
import { Doc, DocListCast, HeightSym, Opt, WidthSym, DocCastAsync } from "../../../fields/Doc";
-import { NumCast, StrCast } from "../../../fields/Types";
+import { NumCast, StrCast, Cast } from "../../../fields/Types";
import { emptyFunction, emptyPath, returnEmptyDoclist, returnEmptyFilter, returnFalse, setupMoveUpEvents, Utils } from "../../../Utils";
import { DocServer } from '../../DocServer';
import { Docs, DocUtils } from "../../documents/Documents";
@@ -14,6 +14,7 @@ import { undoBatch } from '../../util/UndoManager';
import { DocumentView, DocumentViewSharedProps } from "./DocumentView";
import './LinkDocPreview.scss';
import React = require("react");
+import { DocumentType } from '../../documents/DocumentTypes';
interface LinkDocPreviewProps {
linkDoc?: Doc;
@@ -85,7 +86,7 @@ export class LinkDocPreview extends React.Component<LinkDocPreviewProps> {
this._linkDoc = DocListCast(anchor.links)[0];
this._linkSrc = anchor;
const linkTarget = LinkManager.getOppositeAnchor(this._linkDoc, this._linkSrc);
- this._targetDoc = linkTarget?.annotationOn as Doc ?? linkTarget;
+ this._targetDoc = linkTarget?.type === DocumentType.MARKER && linkTarget?.annotationOn ? Cast(linkTarget.annotationOn, Doc, null) ?? linkTarget : linkTarget;
this._toolTipText = "";
}
}));