History

fix(mobile): use tryOpenExternalUrl for markdown links in ThreadFeed (#5872)

mohamedmastouri-hue committed 3 months ago

Commit b277cc61 parent 9f266561 file · +4 −4Browse files

Unified · Split

apps/mobile/src/features/threads/ThreadFeed.tsx+4−4
@@ -28,7 +28,6 @@ import { · 27 unmodified lines
2828 import {
2929 ActivityIndicator,
3030 Image,
31− Linking,
3231 Platform,
3332 type LayoutChangeEvent,
3433 type NativeScrollEvent,
@@ -51,6 +50,7 @@ import { IOS_NAV_BAR_HEIGHT } from "../../lib/layoutMetrics"; · 16 unmodified lines
5150 import { useFontFamily } from "../../lib/useFontFamily";
5251 import { scopedThreadKey } from "../../lib/scopedEntities";
5352 import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
53+import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
5454 import { hasWideMarkdownBlock } from "../../lib/wideMarkdownBlocks";
5555 import {
5656 hasNativeSelectableMarkdownText,
@@ -283,7 +283,7 @@ const MarkdownExternalLink = memo(function MarkdownExternalLink(props: { · 226 unmodified lines
283283 <NativeText
284284 className="font-sans"
285285 onPress={() => {
286− void Linking.openURL(props.href);
286+ void tryOpenExternalUrl(props.href, "markdown-link");
287287 }}
288288 style={{
289289 color: props.color,
@@ -613,7 +613,7 @@ function useMarkdownStyles(onLinkPress: (href: string) => void): MarkdownStyleSe · 323 unmodified lines
613613 onPress={
614614 linkHref
615615 ? () => {
616− void Linking.openURL(linkHref);
616+ void tryOpenExternalUrl(linkHref, "markdown-link");
617617 }
618618 : undefined
619619 }
@@ -1436,7 +1436,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { · 816 unmodified lines
14361436 }
14371437
14381438 if (presentation.href) {
1439− void Linking.openURL(presentation.href);
1439+ void tryOpenExternalUrl(presentation.href, "markdown-link");
14401440 }
14411441 },
14421442 [props.environmentId, props.threadId, props.workspaceRoot, navigation],

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t