🐛 Fix file extension when changing file name (#357)

This commit is contained in:
Montassar Ghanmy
2024-02-05 17:49:45 +01:00
committed by GitHub
parent ceee21b5eb
commit e63ad92f6b
@@ -75,7 +75,8 @@ const PropertiesModalContent = ({ id, onClose }: { id: string; onClose: () => vo
if (!item?.is_directory) {
const lastDotIndex = finalName.lastIndexOf('.');
if (lastDotIndex !== -1) {
finalName = finalName.slice(0, lastDotIndex);
const fileExtension = name.slice(lastDotIndex);
finalName = finalName.slice(0, lastDotIndex) + fileExtension;
}
}
await update({ name: finalName }, id, item.parent_id);