diff --git a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx index 29229fadfd0ad..f2a773c09c099 100644 --- a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx +++ b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.stories.tsx @@ -78,6 +78,10 @@ export const Logs: Story = { ...MockTemplateVersion.job, status: "running", }, + matched_provisioners: { + count: 1, + available: 1, + }, }, }, decorators: [withWebSocket], diff --git a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx index 35ad8eaba60cf..3f7099ebe673a 100644 --- a/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx +++ b/site/src/pages/CreateTemplatePage/BuildLogsDrawer.tsx @@ -29,10 +29,6 @@ export const BuildLogsDrawer: FC = ({ variablesSectionRef, ...drawerProps }) => { - const matchingProvisioners = templateVersion?.matched_provisioners?.count; - const availableProvisioners = - templateVersion?.matched_provisioners?.available; - const logs = useWatchVersionLogs(templateVersion); const logsContainer = useRef(null); @@ -60,6 +56,10 @@ export const BuildLogsDrawer: FC = ({ error instanceof JobError && error.job.error_code === "REQUIRED_TEMPLATE_VARIABLES"; + const matchingProvisioners = templateVersion?.matched_provisioners?.count; + const availableProvisioners = + templateVersion?.matched_provisioners?.available; + return (
@@ -85,7 +85,7 @@ export const BuildLogsDrawer: FC = ({ drawerProps.onClose(); }} /> - ) : logs ? ( + ) : availableProvisioners && availableProvisioners > 0 && logs ? (