diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/hooks/use-child-deployment.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/hooks/use-child-deployment.ts index bdd0240708..666e6705b2 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/hooks/use-child-deployment.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/hooks/use-child-deployment.ts @@ -35,19 +35,12 @@ export function useChildDeployment(childWorkflowId: string | undefined): UseChil try { setIsLoading(true) - // Fetch both deployment versions and workflow metadata in parallel - const [deploymentsRes, workflowRes] = await Promise.all([ - fetch(`/api/workflows/${wfId}/deployments`, { - cache: 'no-store', - headers: { 'Cache-Control': 'no-cache' }, - }), - fetch(`/api/workflows/${wfId}`, { - cache: 'no-store', - headers: { 'Cache-Control': 'no-cache' }, - }), - ]) + const statusRes = await fetch(`/api/workflows/${wfId}/status`, { + cache: 'no-store', + headers: { 'Cache-Control': 'no-cache' }, + }) - if (!deploymentsRes.ok || !workflowRes.ok) { + if (!statusRes.ok) { if (!cancelled) { setActiveVersion(null) setIsDeployed(null) @@ -56,32 +49,30 @@ export function useChildDeployment(childWorkflowId: string | undefined): UseChil return } - const deploymentsJson = await deploymentsRes.json() - const workflowJson = await workflowRes.json() + const statusData = await statusRes.json() - const versions = Array.isArray(deploymentsJson?.data?.versions) - ? deploymentsJson.data.versions - : Array.isArray(deploymentsJson?.versions) - ? deploymentsJson.versions - : [] + const deploymentsRes = await fetch(`/api/workflows/${wfId}/deployments`, { + cache: 'no-store', + headers: { 'Cache-Control': 'no-cache' }, + }) - const active = versions.find((v: any) => v.isActive) - const workflowUpdatedAt = workflowJson?.data?.updatedAt || workflowJson?.updatedAt + let activeVersion = null + if (deploymentsRes.ok) { + const deploymentsJson = await deploymentsRes.json() + const versions = Array.isArray(deploymentsJson?.data?.versions) + ? deploymentsJson.data.versions + : Array.isArray(deploymentsJson?.versions) + ? deploymentsJson.versions + : [] - if (!cancelled) { - const v = active ? Number(active.version) : null - const deployed = v != null - setActiveVersion(v) - setIsDeployed(deployed) + const active = versions.find((v: any) => v.isActive) + activeVersion = active ? Number(active.version) : null + } - // Check if workflow has been updated since deployment - if (deployed && active?.createdAt && workflowUpdatedAt) { - const deploymentTime = new Date(active.createdAt).getTime() - const updateTime = new Date(workflowUpdatedAt).getTime() - setNeedsRedeploy(updateTime > deploymentTime) - } else { - setNeedsRedeploy(false) - } + if (!cancelled) { + setActiveVersion(activeVersion) + setIsDeployed(statusData.isDeployed || false) + setNeedsRedeploy(statusData.needsRedeployment || false) } } catch { if (!cancelled) { diff --git a/apps/sim/components/emails/base-styles.ts b/apps/sim/components/emails/base-styles.ts index 4568984850..633c762eee 100644 --- a/apps/sim/components/emails/base-styles.ts +++ b/apps/sim/components/emails/base-styles.ts @@ -31,7 +31,7 @@ export const baseStyles = { }, button: { display: 'inline-block', - backgroundColor: '#802FFF', + backgroundColor: '#6F3DFA', color: '#ffffff', fontWeight: 'bold', fontSize: '16px', @@ -42,7 +42,7 @@ export const baseStyles = { margin: '20px 0', }, link: { - color: '#802FFF', + color: '#6F3DFA', textDecoration: 'underline', }, footer: { @@ -79,7 +79,7 @@ export const baseStyles = { width: '249px', }, sectionCenter: { - borderBottom: '1px solid #802FFF', + borderBottom: '1px solid #6F3DFA', width: '102px', }, } diff --git a/apps/sim/components/emails/careers-confirmation-email.tsx b/apps/sim/components/emails/careers-confirmation-email.tsx index 01905e3808..bd931d669f 100644 --- a/apps/sim/components/emails/careers-confirmation-email.tsx +++ b/apps/sim/components/emails/careers-confirmation-email.tsx @@ -78,12 +78,12 @@ export const CareersConfirmationEmail = ({ href='https://docs.sim.ai' target='_blank' rel='noopener noreferrer' - style={{ color: '#802FFF', textDecoration: 'none' }} + style={{ color: '#6F3DFA', textDecoration: 'none' }} > documentation {' '} to learn more about what we're building, or check out our{' '} - + blog {' '} for the latest updates. diff --git a/apps/sim/components/emails/careers-submission-email.tsx b/apps/sim/components/emails/careers-submission-email.tsx index deb1f766e9..96246efbcd 100644 --- a/apps/sim/components/emails/careers-submission-email.tsx +++ b/apps/sim/components/emails/careers-submission-email.tsx @@ -144,7 +144,7 @@ export const CareersSubmissionEmail = ({