🐛 Fix file extension when changing file name (#357)
This commit is contained in:
@@ -75,7 +75,8 @@ const PropertiesModalContent = ({ id, onClose }: { id: string; onClose: () => vo
|
|||||||
if (!item?.is_directory) {
|
if (!item?.is_directory) {
|
||||||
const lastDotIndex = finalName.lastIndexOf('.');
|
const lastDotIndex = finalName.lastIndexOf('.');
|
||||||
if (lastDotIndex !== -1) {
|
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);
|
await update({ name: finalName }, id, item.parent_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user