fix: fix redirect timing while enableHome is false; tweak UI (#5538)

This commit is contained in:
伍闲犬
2025-08-26 15:57:38 +08:00
committed by GitHub
parent 2e2e919d1d
commit 4939271abb
4 changed files with 11 additions and 3 deletions

View File

@@ -190,7 +190,7 @@ const HomeChatWindow = ({ myApps }: Props) => {
}; };
useMount(() => { useMount(() => {
if (!feConfigs?.isPlus || !chatSettings?.enableHome) { if (!feConfigs?.isPlus) {
handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS); handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS);
} }
}); });

View File

@@ -63,7 +63,7 @@ const UserAvatarPopover = ({
gap={2} gap={2}
> >
<Avatar src={userInfo?.avatar} bg="myGray.200" borderRadius="50%" w={5} h={5} /> <Avatar src={userInfo?.avatar} bg="myGray.200" borderRadius="50%" w={5} h={5} />
<Box w="full" className="textEllipsis"> <Box flex="1 1 0" minW="0" whiteSpace="pre-wrap">
{userInfo?.username ?? '-'} {userInfo?.username ?? '-'}
</Box> </Box>
</Flex> </Flex>

View File

@@ -255,7 +255,10 @@ const NavigationSection = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { feConfigs } = useSystemStore(); const { feConfigs } = useSystemStore();
const isEnableHome = useContextSelector(ChatSettingContext, (v) => v.chatSettings?.enableHome); const isEnableHome = useContextSelector(
ChatSettingContext,
(v) => v.chatSettings?.enableHome ?? true
);
const isCollapsed = useContextSelector(ChatSettingContext, (v) => v.collapse === 1); const isCollapsed = useContextSelector(ChatSettingContext, (v) => v.collapse === 1);
const onTriggerCollapse = useContextSelector(ChatSettingContext, (v) => v.onTriggerCollapse); const onTriggerCollapse = useContextSelector(ChatSettingContext, (v) => v.onTriggerCollapse);
const isHomeActive = useContextSelector( const isHomeActive = useContextSelector(

View File

@@ -67,6 +67,11 @@ export const ChatSettingContextProvider = ({ children }: { children: React.React
onSuccess: (data) => { onSuccess: (data) => {
if (!data) return; if (!data) return;
if (!data.enableHome && pane === ChatSidebarPaneEnum.HOME) {
handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS);
return;
}
if ( if (
pane === ChatSidebarPaneEnum.HOME && pane === ChatSidebarPaneEnum.HOME &&
appId !== data.appId && appId !== data.appId &&