mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-01 17:59:09 +08:00
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:
parent
42eb61434d
commit
3eee8faad4
@ -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 */}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user