diff --git a/src/editor/FileSelector.vue b/src/editor/FileSelector.vue index 2946cae2..6c81bf7d 100644 --- a/src/editor/FileSelector.vue +++ b/src/editor/FileSelector.vue @@ -58,6 +58,11 @@ function focus({ el }: VNode) { function doneNameFile() { if (!pending.value) return + if (!pendingFilename.value) { + pending.value = false + return + } + // add back the src prefix const filename = 'src/' + pendingFilename.value const oldFilename = pending.value === true ? '' : pending.value