Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Nov 28, 2024
1 parent f9d7905 commit 26ea6c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/components/Projekte/Daten/Apberuebersicht/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import { MenuTitle } from '../../../shared/Files/Menu/index.jsx'
const iconStyle = { color: 'white' }

export const Menu = memo(
observer(({ row }) => {
observer(() => {
const { search, pathname } = useLocation()
const navigate = useNavigate()
const client = useApolloClient()
const queryClient = useQueryClient()
const { projId } = useParams()
const { projId, apberUebersichtId } = useParams()
const store = useContext(StoreContext)

const onClickAdd = useCallback(async () => {
Expand Down Expand Up @@ -81,7 +81,7 @@ export const Menu = memo(
}
}
`,
variables: { id: row.id },
variables: { id: apberUebersichtId },
})
} catch (error) {
return store.enqueNotification({
Expand All @@ -108,7 +108,16 @@ export const Menu = memo(
})
// navigate to parent
navigate(`/Daten/Projekte/${projId}/AP-Berichte${search}`)
}, [client, store, queryClient, navigate, search, projId, row, pathname])
}, [
client,
store,
queryClient,
navigate,
search,
projId,
apberUebersichtId,
pathname,
])

const onClickPrint = useCallback(() => {
navigate(`print${search}`)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Projekte/Daten/Apberuebersicht/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const Component = memo(
<Container>
<FormTitle
title="AP-Bericht Jahresübersicht"
menuBar={<Menu row={row} />}
menuBar={<Menu />}
/>
<FieldsContainer>
<FormContainer>
Expand Down

0 comments on commit 26ea6c9

Please sign in to comment.