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
28import {28import {
29 ActivityIndicator,29 ActivityIndicator,
30 Image,30 Image,
31 Linking,
32 Platform,31 Platform,
33 type LayoutChangeEvent,32 type LayoutChangeEvent,
34 type NativeScrollEvent,33 type NativeScrollEvent,
@@ -51,6 +50,7 @@ import { IOS_NAV_BAR_HEIGHT } from "../../lib/layoutMetrics"; · 16 unmodified lines
51import { useFontFamily } from "../../lib/useFontFamily";50import { useFontFamily } from "../../lib/useFontFamily";
52import { scopedThreadKey } from "../../lib/scopedEntities";51import { scopedThreadKey } from "../../lib/scopedEntities";
53import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";52import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
53import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
54import { hasWideMarkdownBlock } from "../../lib/wideMarkdownBlocks";54import { hasWideMarkdownBlock } from "../../lib/wideMarkdownBlocks";
55import {55import {
56 hasNativeSelectableMarkdownText,56 hasNativeSelectableMarkdownText,
@@ -283,7 +283,7 @@ const MarkdownExternalLink = memo(function MarkdownExternalLink(props: { · 226 unmodified lines
283 <NativeText283 <NativeText
284 className="font-sans"284 className="font-sans"
285 onPress={() => {285 onPress={() => {
286 void Linking.openURL(props.href);286 void tryOpenExternalUrl(props.href, "markdown-link");
287 }}287 }}
288 style={{288 style={{
289 color: props.color,289 color: props.color,
@@ -613,7 +613,7 @@ function useMarkdownStyles(onLinkPress: (href: string) => void): MarkdownStyleSe · 323 unmodified lines
613 onPress={613 onPress={
614 linkHref614 linkHref
615 ? () => {615 ? () => {
616 void Linking.openURL(linkHref);616 void tryOpenExternalUrl(linkHref, "markdown-link");
617 }617 }
618 : undefined618 : undefined
619 }619 }
@@ -1436,7 +1436,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { · 816 unmodified lines
1436 }1436 }
1437 1437
1438 if (presentation.href) {1438 if (presentation.href) {
1439 void Linking.openURL(presentation.href);1439 void tryOpenExternalUrl(presentation.href, "markdown-link");
1440 }1440 }
1441 },1441 },
1442 [props.environmentId, props.threadId, props.workspaceRoot, navigation],1442 [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