Skip to content

Commit

Permalink
refactor(SaveSegmentGroupDialog): emit event rather than close prop
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulHax committed Feb 23, 2024
1 parent d2c00f1 commit 6c0f098
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/SaveSegmentGroupDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ const EXTENSIONS = [
];
const props = defineProps<{
close: () => void;
id: string;
}>();
const emit = defineEmits(['done']);
const fileName = ref('');
const valid = ref(true);
const saving = ref(false);
Expand All @@ -79,7 +81,7 @@ async function saveSegmentGroup() {
saveAs(new Blob([serialized]), `${fileName.value}.${fileFormat.value}`);
});
saving.value = false;
props.close();
emit('done');
}
onMounted(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SegmentGroupControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function openSaveDialog(id: string) {

<closeable-dialog v-model="saveDialog" max-width="30%">
<template v-slot="{ close }">
<save-segment-group-dialog :close="close" :id="saveId" />
<save-segment-group-dialog :id="saveId" @done="close" />
</template>
</closeable-dialog>
</template>
Expand Down

0 comments on commit 6c0f098

Please sign in to comment.