From 188a70de2147dda2dbd9bcc952aefa0227506b4a Mon Sep 17 00:00:00 2001 From: karamvir Date: Thu, 17 Aug 2023 15:04:43 -0700 Subject: [PATCH] rm conditonal hook call, make consistent --- frontend/src/resources/alerter/index.tsx | 2 +- frontend/src/resources/build/index.tsx | 2 +- frontend/src/resources/builder/index.tsx | 3 +-- frontend/src/resources/deployment/index.tsx | 2 +- frontend/src/resources/repo/index.tsx | 2 +- frontend/src/resources/server/index.tsx | 3 +-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/resources/alerter/index.tsx b/frontend/src/resources/alerter/index.tsx index 56632b711..45ed255d7 100644 --- a/frontend/src/resources/alerter/index.tsx +++ b/frontend/src/resources/alerter/index.tsx @@ -93,8 +93,8 @@ export const AlerterConfig = ({ id }: { id: string }) => { export const AlerterPage = () => { const id = useParams().alerterId; - if (!id) return null; useAddRecentlyViewed("Alerter", id); + if (!id) return null; return ( { export const BuildPage = () => { const id = useParams().buildId; - if (!id) return null; useAddRecentlyViewed("Build", id); + if (!id) return null; return ( { export const BuilderPage = () => { const id = useParams().builderId; - - if (!id) return null; useAddRecentlyViewed("Builder", id); + if (!id) return null; return ( } info={<>} actions={<>}> diff --git a/frontend/src/resources/deployment/index.tsx b/frontend/src/resources/deployment/index.tsx index 8f9aa33f0..22ab2c37e 100644 --- a/frontend/src/resources/deployment/index.tsx +++ b/frontend/src/resources/deployment/index.tsx @@ -37,8 +37,8 @@ export const DeploymentCard = ({ id }: { id: string }) => { export const DeploymentPage = () => { const id = useParams().deploymentId; - if (!id) return null; useAddRecentlyViewed("Deployment", id); + if (!id) return null; return ( { export const RepoPage = () => { const id = useParams().repoId; - if (!id) return null; useAddRecentlyViewed("Repo", id); + if (!id) return null; return ( diff --git a/frontend/src/resources/server/index.tsx b/frontend/src/resources/server/index.tsx index f088fcd1e..b610267ee 100644 --- a/frontend/src/resources/server/index.tsx +++ b/frontend/src/resources/server/index.tsx @@ -72,9 +72,8 @@ const ServerConfig = ({ id }: { id: string }) => { export const ServerPage = () => { const id = useParams().serverId; - - if (!id) return null; useAddRecentlyViewed("Server", id); + if (!id) return null; return (