Prevent slashes in folder names for storage explorer

This commit is contained in:
Joshen Lim committed 2022-03-28 16:52:32 +08:00
1 parent 69a2f2d121
commit f280ca24d8
1 file changed
+4
@@ -275,9 +275,13 @@ class StorageExplorerStore {
addNewFolder = async (folderName, columnIndex) => {
const autofix = false
const formattedName = this.sanitizeNameForDuplicateInColumn(folderName, autofix, columnIndex)
if (isNull(formattedName)) {
return
}
if (formattedName.includes('/') || formattedName.includes('\\')) {
return toast.error('Folder names should not have forward or back slashes.')
}
if (formattedName.length === 0) {
return this.removeTempRows(columnIndex)
}