Skip to content

Commit

Permalink
πŸ› fix: Fixed mobile web page navigation issue with inbox assistant (l…
Browse files Browse the repository at this point in the history
  • Loading branch information
RubuJam authored Jul 7, 2024
1 parent f5fe60a commit 4476a5e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/(main)/settings/_layout/Mobile/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { MobileNavBar, MobileNavBarTitle } from '@lobehub/ui';
import { Tag } from 'antd';
import { useRouter } from 'next/navigation';
import { useRouter, useSearchParams } from 'next/navigation';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
Expand All @@ -16,7 +16,17 @@ const Header = memo(() => {
const { t } = useTranslation('setting');

const router = useRouter();
const searchParams = useSearchParams();
const activeSettingsKey = useActiveSettingsKey();

const handleBackClick = () => {
if (searchParams.has('session') && searchParams.has('showMobileWorkspace')) {
router.push(`/chat?${searchParams.toString()}`);
} else {
router.push(enableAuth ? '/me/settings' : '/me');
}
};

return (
<MobileNavBar
center={
Expand All @@ -33,7 +43,7 @@ const Header = memo(() => {
}
/>
}
onBackClick={() => router.push(enableAuth ? '/me/settings' : '/me')}
onBackClick={handleBackClick}
showBackButton
style={mobileHeaderSticky}
/>
Expand Down

0 comments on commit 4476a5e

Please sign in to comment.