Fix create variable modal not resetting in function wizard

This commit is contained in:
Steven Nguyen committed 2022-11-22 10:17:27 -08:00
1 parent b68d0856d6
commit ccf8df07cc
1 file changed
+9 -4
@@ -16,14 +16,19 @@
const dispatch = createEventDispatcher();
const handleVariable = () => {
function close() {
showCreate = false;
selectedVar = null;
}
function handleVariable() {
if (selectedVar) {
dispatch('updated', pair);
} else {
dispatch('created', pair);
}
showCreate = false;
};
close();
}
</script>
<Modal bind:show={showCreate} on:submit={handleVariable} size="big">
@@ -48,7 +53,7 @@
required />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (showCreate = false)}>Cancel</Button>
<Button secondary on:click={close}>Cancel</Button>
<Button submit>{selectedVar ? 'Update' : 'Create'}</Button>
</svelte:fragment>
</Modal>