diff --git a/apps/readest-app/src/components/Link.tsx b/apps/readest-app/src/components/Link.tsx index 9c49a5b7..7a815ea3 100644 --- a/apps/readest-app/src/components/Link.tsx +++ b/apps/readest-app/src/components/Link.tsx @@ -6,16 +6,24 @@ interface LinkProps extends React.AnchorHTMLAttributes { title?: string; } +const isTauri = isTauriAppPlatform(); + const Link: React.FC = ({ href, children, ...props }) => { const handleClick = async (e: React.MouseEvent) => { - if (isTauriAppPlatform()) { + if (isTauri) { e.preventDefault(); await openUrl(href); } }; return ( - + {children} );