fix: active modal

This commit is contained in:
Arman
2025-03-13 12:11:01 +01:00
parent f52bb88768
commit 4c6113d822
2 changed files with 12 additions and 11 deletions
@@ -9,7 +9,7 @@
export let showActivate = false;
export let selectedDeployment: Models.Deployment = null;
let error = null;
const dispatch = createEventDispatcher();
const handleSubmit = async () => {
@@ -25,17 +25,18 @@
});
dispatch('activated');
trackEvent(Submit.DeploymentUpdate);
} catch (error) {
addNotification({
type: 'error',
message: error.message
});
trackError(error, Submit.DeploymentUpdate);
} catch (e) {
error = e.message;
trackError(e, Submit.DeploymentUpdate);
}
};
$: if (!showActivate) {
error = null;
}
</script>
<Confirm title="Activate deployment" bind:open={showActivate} onSubmit={handleSubmit}>
<Confirm title="Activate deployment" bind:open={showActivate} onSubmit={handleSubmit} bind:error>
<p>This deployment is ready but not yet live. Activate it to make it publicly accessible.</p>
<svelte:fragment slot="footer">
<Button text on:click={() => (showActivate = false)}>Cancel</Button>
@@ -1,6 +1,6 @@
<script lang="ts">
import { Button } from '$lib/elements/forms';
import { Modal } from '$lib/components';
import { Confirm } from '$lib/components';
import { sdk } from '$lib/stores/sdk';
import { addNotification } from '$lib/stores/notifications';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
@@ -31,7 +31,7 @@
}
</script>
<Modal title="Activate deployment" bind:show bind:error onSubmit={activate}>
<Confirm title="Activate deployment" bind:open={show} bind:error onSubmit={activate}>
<p class="text">
This deployment is ready but not yet live. Activate it to make it publicly accessible.
</p>
@@ -40,4 +40,4 @@
<Button secondary on:click={() => (show = false)}>Cancel</Button>
<Button submit>Activate</Button>
</svelte:fragment>
</Modal>
</Confirm>