Don't clear link preview on text selection

This commit is contained in:
Fedor Indutny
2025-11-06 12:27:42 -08:00
committed by GitHub
parent fbffca4f8e
commit ef5dabed83

View File

@@ -96,11 +96,15 @@ function _maybeGrabLinkPreview(
return;
}
const links = LinkPreview.findLinks(message, caretLocation);
if (currentlyMatchedLink && links.includes(currentlyMatchedLink)) {
return;
if (currentlyMatchedLink) {
const allLinks = LinkPreview.findLinks(message);
if (allLinks.includes(currentlyMatchedLink)) {
return;
}
}
const links = LinkPreview.findLinks(message, caretLocation);
currentlyMatchedLink = undefined;
excludedPreviewUrls = excludedPreviewUrls || [];