From 2842d439cdf490c2af027062e4ec70a392820e5a Mon Sep 17 00:00:00 2001 From: ousugo Date: Mon, 17 Feb 2025 15:21:13 +0800 Subject: [PATCH] fix: open current webview URL when launching external link --- src/renderer/src/components/MinApp/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/MinApp/index.tsx b/src/renderer/src/components/MinApp/index.tsx index 5b66329c01..3cb67076d7 100644 --- a/src/renderer/src/components/MinApp/index.tsx +++ b/src/renderer/src/components/MinApp/index.tsx @@ -49,7 +49,10 @@ const PopupContainer: React.FC = ({ app, resolve }) => { } const onOpenLink = () => { - window.api.openWebsite(app.url) + if (webviewRef.current) { + const currentUrl = webviewRef.current.getURL() + window.api.openWebsite(currentUrl) + } } const onTogglePin = () => {