diff --git a/frontend/components/actions/CreateDirectoryDialog.vue b/frontend/components/actions/CreateDirectoryDialog.vue index abce476..156da96 100644 --- a/frontend/components/actions/CreateDirectoryDialog.vue +++ b/frontend/components/actions/CreateDirectoryDialog.vue @@ -17,6 +17,10 @@ const creating = ref(false); const directoryNameValid = computed(() => dialog.value.trim().length > 0); async function submit() { + if (!directoryNameValid.value || creating.value) { + return; + } + creating.value = true; const { success } = await createDirectory(warrenRoute.value, dialog.value); @@ -27,6 +31,12 @@ async function submit() { dialog.reset(); } } + +function onKeyDown(e: KeyboardEvent) { + if (e.key === 'Enter') { + submit(); + } +}