Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 49s

This commit is contained in:
Adisak 2025-10-31 16:34:42 +07:00
commit d5e7a721ac

View file

@ -181,11 +181,13 @@ export class DocumentController extends Controller {
let fileList = !body.replace
? body.fileList.map(({ fileName, ...props }) => {
const dotIndex = fileName.lastIndexOf(".");
const originalName =
let originalName =
dotIndex !== -1 && !fileName.startsWith(".") ? fileName.slice(0, dotIndex) : fileName;
const extension =
dotIndex !== -1 && !fileName.startsWith(".") ? fileName.slice(dotIndex) : "";
if([...originalName].length > 95){
originalName = [...originalName].slice(0, 95).join('');
}
let i = 1;
while (list.findIndex((v) => v.fileName === fileName) !== -1 || used.includes(fileName)) {
fileName = `${originalName} (${i++})`;