Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: AI Chat - Clicking Logo After AI Search Does Not Route to Home Page #1925

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/components/App/MainToolbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useNavigate } from 'react-router-dom'
import styled from 'styled-components'
import AddContentIcon from '~/components/Icons/AddContentIcon'
import AddSourceIcon from '~/components/Icons/AddSourceIcon'
Expand All @@ -7,12 +8,12 @@ import SettingsIcon from '~/components/Icons/SettingsIcon'
import SourcesTableIcon from '~/components/Icons/SourcesTableIcon'
import { Flex } from '~/components/common/Flex'
import { Text } from '~/components/common/Text'
import { useAiSummaryStore } from '~/stores/useAiSummaryStore'
import { useFeatureFlagStore } from '~/stores/useFeatureFlagStore'
import { useModal } from '~/stores/useModalStore'
import { useUserStore } from '~/stores/useUserStore'
import { colors } from '~/utils/colors'
import { isSphinx } from '~/utils/isSphinx'
import { useNavigate } from 'react-router-dom'

export const MainToolbar = () => {
const { open: openSourcesModal } = useModal('sourcesTable')
Expand All @@ -23,15 +24,21 @@ export const MainToolbar = () => {
const { open: openFeedbackModal } = useModal('feedback')
const navigate = useNavigate()

const { resetAiSummaryAnswer } = useAiSummaryStore()
const customSchemaFeatureFlag = useFeatureFlagStore((s) => s.customSchemaFeatureFlag)
const userFeedbackFeatureFlag = useFeatureFlagStore((s) => s.userFeedbackFeatureFlag)

const [isAdmin] = useUserStore((s) => [s.isAdmin])
const sphinxEnabled = isSphinx()

const handleLogoClick = () => {
resetAiSummaryAnswer()
navigate('/')
}

return (
<Wrapper>
<LogoButton onClick={() => navigate('/')}>
<LogoButton onClick={handleLogoClick}>
<img alt="Second brain" src="logo.svg" />
</LogoButton>
{isAdmin ? (
Expand Down
Loading