mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: active modal
This commit is contained in:
+9
-8
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user