From b16301248861b502cecad5db565a34201f4bae45 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Fri, 13 Mar 2026 00:29:04 +0800 Subject: [PATCH] fix(link): prevent opening duplicate browser tabs on Tauri, closes #3514 (#3525) --- apps/readest-app/src/components/Link.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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} );