diff --git a/src/renderer/src/components/app/Sidebar.tsx b/src/renderer/src/components/app/Sidebar.tsx index 355a30a5..94cd5610 100644 --- a/src/renderer/src/components/app/Sidebar.tsx +++ b/src/renderer/src/components/app/Sidebar.tsx @@ -77,9 +77,11 @@ const Sidebar: FC = () => { )} - + - + @@ -93,8 +95,14 @@ const Sidebar: FC = () => { - to(isLocalAi ? '/settings/assistant' : '/settings/provider')}> - + { + if (minappShow) { + await MinApp.close() + } + await to(isLocalAi ? '/settings/assistant' : '/settings/provider') + }}> + @@ -108,10 +116,11 @@ const MainMenus: FC = () => { const { t } = useTranslation() const { pathname } = useLocation() const { sidebarIcons } = useSettings() + const { minappShow } = useRuntime() const navigate = useNavigate() - const isRoute = (path: string): string => (pathname === path ? 'active' : '') - const isRoutes = (path: string): string => (pathname.startsWith(path) ? 'active' : '') + const isRoute = (path: string): string => (pathname === path && !minappShow ? 'active' : '') + const isRoutes = (path: string): string => (pathname.startsWith(path) && !minappShow ? 'active' : '') const iconMap = { assistants: , @@ -139,7 +148,13 @@ const MainMenus: FC = () => { return ( - navigate(path)}> + { + if (minappShow) { + await MinApp.close() + } + navigate(path) + }}> {iconMap[icon]} @@ -150,6 +165,7 @@ const MainMenus: FC = () => { const PinnedApps: FC = () => { const { pinned, updatePinnedMinapps } = useMinapps() const { t } = useTranslation() + const { minappShow } = useRuntime() return ( @@ -164,11 +180,12 @@ const PinnedApps: FC = () => { } } ] + const isActive = minappShow && MinApp.app?.id === app.id return ( - MinApp.start(app)}> + MinApp.start(app)} className={isActive ? 'active' : ''}>