Skip to content

Commit ba8e588

Browse files
Don't clear link preview on text selection
Co-authored-by: Fedor Indutny <[email protected]>
1 parent 1ded128 commit ba8e588

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ts/services/LinkPreview.preload.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,15 @@ function _maybeGrabLinkPreview(
9696
return;
9797
}
9898

99-
const links = LinkPreview.findLinks(message, caretLocation);
100-
if (currentlyMatchedLink && links.includes(currentlyMatchedLink)) {
101-
return;
99+
if (currentlyMatchedLink) {
100+
const allLinks = LinkPreview.findLinks(message);
101+
102+
if (allLinks.includes(currentlyMatchedLink)) {
103+
return;
104+
}
102105
}
103106

107+
const links = LinkPreview.findLinks(message, caretLocation);
104108
currentlyMatchedLink = undefined;
105109
excludedPreviewUrls = excludedPreviewUrls || [];
106110

0 commit comments

Comments
 (0)