Skip to content

Commit 8527242

Browse files
committed
Apply extension error to rename
1 parent c88237a commit 8527242

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

site/src/components/TemplateVersionEditor/FileDialog.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ export const RenameFileDialog: FC<{
124124
setError("File already exists")
125125
return
126126
}
127+
if (!isAllowedFile(pathValue)) {
128+
const extensions = allowedExtensions.join(", ")
129+
setError(
130+
`This extension is not allowed. You only can create files with the following extensions: ${extensions}.`,
131+
)
132+
return
133+
}
127134
onConfirm(pathValue)
128135
setPathValue("")
129136
}

0 commit comments

Comments
 (0)