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
This commit is contained in:
George·Dong 2025-09-10 09:38:34 +08:00 committed by GitHub
parent 42eb61434d
commit 3eee8faad4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -283,13 +283,6 @@ const MinappPopupContainer: React.FC = () => {
/** the callback function to set the webviews ref */ /** the callback function to set the webviews ref */
const handleWebviewSetRef = (appid: string, element: WebviewTag | null) => { 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) { if (element) {
webviewRefs.current.set(appid, element) webviewRefs.current.set(appid, element)
} else { } else {
@ -401,10 +394,10 @@ const MinappPopupContainer: React.FC = () => {
navigator.clipboard navigator.clipboard
.writeText(url) .writeText(url)
.then(() => { .then(() => {
window.message.success('URL ' + t('message.copy.success')) window.toast.addToast({ title: 'URL ' + t('message.copy.success') })
}) })
.catch(() => { .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: { content: {
backgroundColor: window.root.style.background backgroundColor: window.root.style.background
},
body: {
borderTopLeftRadius: '10px'
} }
}}> }}>
{/* 在所有小程序中显示GoogleLoginTip */} {/* 在所有小程序中显示GoogleLoginTip */}