@lvce-editor/explorer-view 2.44.0 → 2.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -978,10 +978,10 @@ const createNewDirentsAccept = async (newFileName, pathSeparator, absolutePath,
|
|
|
978
978
|
await createNestedPath(root, parentPath, pathSeparator);
|
|
979
979
|
}
|
|
980
980
|
await createFn(absolutePath);
|
|
981
|
-
return
|
|
981
|
+
return '';
|
|
982
982
|
} catch (error) {
|
|
983
983
|
console.error(new VError(error, `Failed to create file`));
|
|
984
|
-
return
|
|
984
|
+
return `${error}`;
|
|
985
985
|
}
|
|
986
986
|
};
|
|
987
987
|
|
|
@@ -1481,9 +1481,12 @@ const acceptCreate = async (state, newDirentType, createFn) => {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
const parentFolder = getParentFolder(items, focusedIndex, root);
|
|
1483
1483
|
const absolutePath = join2(parentFolder, newFileName);
|
|
1484
|
-
const
|
|
1485
|
-
if (
|
|
1486
|
-
return
|
|
1484
|
+
const createErrorMessage = await createNewDirentsAccept(newFileName, pathSeparator, absolutePath, root, createFn);
|
|
1485
|
+
if (createErrorMessage) {
|
|
1486
|
+
return {
|
|
1487
|
+
...state,
|
|
1488
|
+
editingErrorMessage: createErrorMessage
|
|
1489
|
+
};
|
|
1487
1490
|
}
|
|
1488
1491
|
const pathPaths = getPathParts(root, absolutePath, pathSeparator);
|
|
1489
1492
|
const children = await getPathPartsChildren(pathPaths);
|