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