mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
fix: animation on resolving SelectModelPopup (#5947)
This commit is contained in:
parent
b1d87321aa
commit
b9224ed311
@ -256,12 +256,11 @@ const PopupContainer: React.FC<Props> = ({ model, resolve }) => {
|
||||
const handleItemClick = useCallback(
|
||||
(item: FlatListItem) => {
|
||||
if (item.type === 'model') {
|
||||
setScrollTrigger('initial')
|
||||
resolve(item.model)
|
||||
setOpen(false)
|
||||
}
|
||||
},
|
||||
[resolve, setScrollTrigger]
|
||||
[resolve]
|
||||
)
|
||||
|
||||
// 处理键盘导航
|
||||
@ -633,16 +632,7 @@ export class SelectModelPopup {
|
||||
|
||||
static show(params: PopupParams) {
|
||||
return new Promise<Model | undefined>((resolve) => {
|
||||
TopView.show(
|
||||
<PopupContainer
|
||||
{...params}
|
||||
resolve={(v) => {
|
||||
resolve(v)
|
||||
TopView.hide(TopViewKey)
|
||||
}}
|
||||
/>,
|
||||
TopViewKey
|
||||
)
|
||||
TopView.show(<PopupContainer {...params} resolve={(v) => resolve(v)} />, TopViewKey)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user