Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

⚡️ perf: revert dropdown prefetch (#10279)

Arvin Xu5ce5532a0e13
diff --git a/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx b/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx
index 3a14dddb2b6..9440ce460d7 100644
--- a/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx
+++ b/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx
@@ -30,29 +30,14 @@ export interface ActionDropdownProps extends DropdownProps {
}
const ActionDropdown = memo<ActionDropdownProps>(
- ({
- menu,
- maxHeight,
- minWidth,
- maxWidth,
- children,
- placement = 'top',
- prefetch = false,
- destroyOnHidden,
- forceRender,
- ...rest
- }) => {
+ ({ menu, maxHeight, minWidth, maxWidth, children, placement = 'top', ...rest }) => {
const { cx, styles } = useStyles();
const isMobile = useIsMobile();
- const dropdownForceRender = prefetch ? true : forceRender;
- const dropdownDestroyOnHidden = prefetch ? false : destroyOnHidden;
-
return (
<Dropdown
arrow={false}
- destroyOnHidden={dropdownDestroyOnHidden}
- forceRender={dropdownForceRender}
+ destroyOnHidden={false}
menu={{
...menu,
className: cx(styles.dropdownMenu, menu.className),
diff --git a/src/features/ModelSwitchPanel/index.tsx b/src/features/ModelSwitchPanel/index.tsx
index f84b0665096..19575003a18 100644
--- a/src/features/ModelSwitchPanel/index.tsx
+++ b/src/features/ModelSwitchPanel/index.tsx
@@ -146,7 +146,6 @@ const ModelSwitchPanel = memo<IProps>(({ children, onOpenChange, open }) => {
onOpenChange={onOpenChange}
open={open}
placement={'topLeft'}
- prefetch
>
{icon}
</ActionDropdown>