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 {
|
||||
ActivityIndicator,
|
||||
Image as RNImage,
|
||||
Linking,
|
||||
ScrollView as RNScrollView,
|
||||
Text,
|
||||
type TextProps,
|
||||
@@ -25,6 +24,7 @@ import { useIsCompactFormFactor } from "@/constants/layout";
|
||||
import { useSessionStore, type ExplorerFile } from "@/stores/session-store";
|
||||
import { useWebScrollViewScrollbar } from "@/components/use-web-scrollbar";
|
||||
import { useWebScrollbarStyle } from "@/hooks/use-web-scrollbar-style";
|
||||
import { openExternalUrl } from "@/utils/open-external-url";
|
||||
import { highlightCode, type HighlightToken } from "@getpaseo/highlight";
|
||||
import { syntaxTokenStyleFor } from "@/styles/syntax-token-styles";
|
||||
import { inlineUnistylesStyle } from "@/styles/unistyles-inline-style";
|
||||
@@ -208,7 +208,7 @@ function FilePreviewMarkdownLink({
|
||||
const handlePress = useCallback(() => {
|
||||
if (!href) return;
|
||||
if (onLinkPress?.(href) === false) return;
|
||||
void Linking.openURL(href);
|
||||
void openExternalUrl(href);
|
||||
}, [href, onLinkPress]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user