Open file preview markdown links in external browser
FilePreviewMarkdownLink was using Linking.openURL directly, which on web/Electron performs a plain navigation that opens inside the app window. Use openExternalUrl instead so desktop builds route through the preload bridge to shell.openExternal.
This commit is contained in:
@@ -9,7 +9,6 @@ import Markdown, {
|
|||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Image as RNImage,
|
Image as RNImage,
|
||||||
Linking,
|
|
||||||
ScrollView as RNScrollView,
|
ScrollView as RNScrollView,
|
||||||
Text,
|
Text,
|
||||||
type TextProps,
|
type TextProps,
|
||||||
@@ -25,6 +24,7 @@ import { useIsCompactFormFactor } from "@/constants/layout";
|
|||||||
import { useSessionStore, type ExplorerFile } from "@/stores/session-store";
|
import { useSessionStore, type ExplorerFile } from "@/stores/session-store";
|
||||||
import { useWebScrollViewScrollbar } from "@/components/use-web-scrollbar";
|
import { useWebScrollViewScrollbar } from "@/components/use-web-scrollbar";
|
||||||
import { useWebScrollbarStyle } from "@/hooks/use-web-scrollbar-style";
|
import { useWebScrollbarStyle } from "@/hooks/use-web-scrollbar-style";
|
||||||
|
import { openExternalUrl } from "@/utils/open-external-url";
|
||||||
import { highlightCode, type HighlightToken } from "@getpaseo/highlight";
|
import { highlightCode, type HighlightToken } from "@getpaseo/highlight";
|
||||||
import { syntaxTokenStyleFor } from "@/styles/syntax-token-styles";
|
import { syntaxTokenStyleFor } from "@/styles/syntax-token-styles";
|
||||||
import { inlineUnistylesStyle } from "@/styles/unistyles-inline-style";
|
import { inlineUnistylesStyle } from "@/styles/unistyles-inline-style";
|
||||||
@@ -208,7 +208,7 @@ function FilePreviewMarkdownLink({
|
|||||||
const handlePress = useCallback(() => {
|
const handlePress = useCallback(() => {
|
||||||
if (!href) return;
|
if (!href) return;
|
||||||
if (onLinkPress?.(href) === false) return;
|
if (onLinkPress?.(href) === false) return;
|
||||||
void Linking.openURL(href);
|
void openExternalUrl(href);
|
||||||
}, [href, onLinkPress]);
|
}, [href, onLinkPress]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user