Skip to content

Commit

Permalink
Normalize uploading file name
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed May 13, 2024
1 parent 96ab341 commit f25b698
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib/services/assets/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const saveAssets = async (uploadingAssets, options) => {
);

const savingFileList = files.map((file) => {
const name = originalAsset?.name ?? renameIfNeeded(file.name, assetNamesInSameFolder);
const name =
originalAsset?.name ?? renameIfNeeded(file.name.normalize(), assetNamesInSameFolder);

if (!assetNamesInSameFolder.includes(name)) {
assetNamesInSameFolder.push(name);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/contents/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ export const saveEntry = async ({ skipCI = undefined } = {}) => {
continue;
}

const _fileName = renameIfNeeded(file.name, [
const _fileName = renameIfNeeded(file.name.normalize(), [
...assetsInSameFolder,
...savingAssets.map((a) => a.name),
]);
Expand Down

0 comments on commit f25b698

Please sign in to comment.