From 3eee8faad450fb0409dc0fcaf3645fb28472900b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=C2=B7Dong?= <98630204+GeorgeDong32@users.noreply.github.com> Date: Wed, 10 Sep 2025 09:38:34 +0800 Subject: [PATCH] fix(minapps): optimize minapps (#10076) * fix(minapp): simplify webview ref handling and use toast for copy * fix(minapp): add body border radius to popup container --- .../src/components/MinApp/MinappPopupContainer.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/renderer/src/components/MinApp/MinappPopupContainer.tsx b/src/renderer/src/components/MinApp/MinappPopupContainer.tsx index 347088f500..fcee851ee3 100644 --- a/src/renderer/src/components/MinApp/MinappPopupContainer.tsx +++ b/src/renderer/src/components/MinApp/MinappPopupContainer.tsx @@ -283,13 +283,6 @@ const MinappPopupContainer: React.FC = () => { /** the callback function to set the webviews ref */ const handleWebviewSetRef = (appid: string, element: WebviewTag | null) => { - webviewRefs.current.set(appid, element) - - if (!webviewRefs.current.has(appid)) { - webviewRefs.current.set(appid, null) - return - } - if (element) { webviewRefs.current.set(appid, element) } else { @@ -401,10 +394,10 @@ const MinappPopupContainer: React.FC = () => { navigator.clipboard .writeText(url) .then(() => { - window.message.success('URL ' + t('message.copy.success')) + window.toast.addToast({ title: 'URL ' + t('message.copy.success') }) }) .catch(() => { - window.message.error('URL ' + t('message.copy.failed')) + window.toast.addToast({ title: 'URL ' + t('message.copy.failed') }) }) } @@ -550,6 +543,9 @@ const MinappPopupContainer: React.FC = () => { }, content: { backgroundColor: window.root.style.background + }, + body: { + borderTopLeftRadius: '10px' } }}> {/* 在所有小程序中显示GoogleLoginTip */}