Skip to content

Commit

Permalink
Modal now submits properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Jul 27, 2023
1 parent 5d1eca5 commit 2881b4c
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<script lang="ts">
import Modal from '$lib/components/modals/Modal.svelte';
import Modal, { DialogResponse } from '$lib/components/modals/Modal.svelte';
import Form from '$lib/forms/Form.svelte';
import t from '$lib/i18n';
import Checkbox from '$lib/forms/Checkbox.svelte';
import Button from '$lib/forms/Button.svelte';
let modal: Modal;
export async function open(): Promise<void> {
export async function open(): Promise<DialogResponse> {
console.log('Opening modal', modal);
await modal.openModal();
const x = await modal.openModal();
console.log('Response', x);
return x;
}
export function submit(): void {
modal.submitModal();
modal.close();
}
export function close(): void {
Expand All @@ -29,7 +36,7 @@
<Checkbox bind:value={confirmCheck} label={$t('project_page.reset_project_model.confirm_downloaded')} />
</Form>
<svelte:fragment slot="actions" let:submitting>
<Button type="submit" on:click style="btn-primary" loading={submitting} disabled={!confirmCheck}>
<Button type="submit" style="btn-primary" on:click={submit} loading={submitting} disabled={!confirmCheck}>
<span>{$t('project_page.reset_project')}</span>
</Button>
</svelte:fragment>
Expand Down

0 comments on commit 2881b4c

Please sign in to comment.