fix: logic

This commit is contained in:
Arman
2025-05-21 10:23:20 +02:00
parent b0aee1feee
commit a986ad0bcb
2 changed files with 17 additions and 15 deletions
@@ -58,15 +58,11 @@
</Empty>
</Card.Base>
{:else}
{@const activeDeployment = data.activeDeployment}
{@const activeDeployment = data?.activeDeployment}
{#if data?.activeDeployment && !$func.live && showAlert}
{#if data.deploymentList.deployments[0]?.status !== 'failed' && data.deploymentList.deployments[0]?.status !== 'ready'}
<Alert.Inline status="info" dismissible on:dismiss={() => (showAlert = false)}>
Some configuration changes are not live yet. Your function is currently
redeploying, and changes will be applied once the build is complete.
</Alert.Inline>
{:else}
{#if activeDeployment && !$func.live && showAlert}
{@const latestDeployment = data.deploymentList.deployments[0]}
{#if latestDeployment?.status === 'failed' || latestDeployment?.status === 'ready'}
<Alert.Inline status="warning" dismissible on:dismiss={() => (showAlert = false)}>
Some configuration options are not live yet. Redeploy your function to apply
latest changes.
@@ -74,13 +70,18 @@
<Button
compact
on:click={() => {
selectedDeployment = data.activeDeployment;
selectedDeployment = activeDeployment;
showRedeploy = true;
}}>
Redeploy
</Button>
</svelte:fragment>
</Alert.Inline>
{:else}
<Alert.Inline status="info" dismissible on:dismiss={() => (showAlert = false)}>
Some configuration changes are not live yet. Your function is currently
redeploying, and changes will be applied once the build is complete.
</Alert.Inline>
{/if}
{/if}
<Layout.Stack gap="xxxl">
@@ -77,12 +77,8 @@
<Container>
<Layout.Stack gap="xxxl">
{#if data?.activeDeployment && !data.site.live && showAlert}
{#if data.deploymentList.deployments[0]?.status !== 'failed' && data.deploymentList.deployments[0]?.status !== 'ready'}
<Alert.Inline status="info" dismissible on:dismiss={() => (showAlert = false)}>
Some configuration changes are not live yet. Your site is currently redeploying,
and changes will be applied once the build is complete.
</Alert.Inline>
{:else}
{@const latestDeployment = data.deploymentList.deployments[0]}
{#if latestDeployment?.status === 'failed' || latestDeployment?.status === 'ready'}
<Alert.Inline status="warning" dismissible on:dismiss={() => (showAlert = false)}>
Some configuration changes are not live yet. Redeploy your site to apply latest
changes.
@@ -97,6 +93,11 @@
</Button>
</svelte:fragment>
</Alert.Inline>
{:else}
<Alert.Inline status="info" dismissible on:dismiss={() => (showAlert = false)}>
Some configuration changes are not live yet. Your site is currently redeploying,
and changes will be applied once the build is complete.
</Alert.Inline>
{/if}
{/if}