Skip to content

Commit

Permalink
fix(graph): reset graph clicking home logo button and logo text
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoaibdev7 committed Sep 17, 2024
1 parent 3679f4d commit 5b37915
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/App/AppBar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { useNavigate } from 'react-router-dom'
import styled from 'styled-components'
import { Flex } from '~/components/common/Flex'
import { Text } from '~/components/common/Text'
import { Stats } from '~/components/Stats'
import { useAiSummaryStore } from '~/stores/useAiSummaryStore'
import { useAppStore } from '~/stores/useAppStore'
import { useDataStore } from '~/stores/useDataStore'
import { colors } from '~/utils/colors'
import { media } from '~/utils/media'
import { useAiSummaryStore } from '~/stores/useAiSummaryStore'
import { useDataStore } from '~/stores/useDataStore'
import { useNavigate } from 'react-router-dom'

export const AppBar = () => {
const appMetaData = useAppStore((s) => s.appMetaData)
const { resetAiSummaryAnswer, setNewLoading } = useAiSummaryStore()
const { abortFetchData } = useDataStore((s) => s)
const { abortFetchData, resetGraph } = useDataStore((s) => s)
const navigate = useNavigate()

if (!appMetaData) {
Expand All @@ -22,6 +22,7 @@ export const AppBar = () => {
const handleLogoClick = () => {
setNewLoading(null)
abortFetchData()
resetGraph()
resetAiSummaryAnswer()
navigate('/')
}
Expand Down
1 change: 1 addition & 0 deletions src/stores/useDataStore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export const useDataStore = create<DataStore>()(
resetGraph: () => {
set({
filters: defaultData.filters,
dataInitial: null,
dataNew: null,
})

Expand Down

0 comments on commit 5b37915

Please sign in to comment.