From e63ad92f6b88c6c6c07d3b5fec880b7487717b40 Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Mon, 5 Feb 2024 17:49:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20file=20extension=20when=20?= =?UTF-8?q?changing=20file=20name=20(#357)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/views/client/body/drive/modals/properties/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/properties/index.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/properties/index.tsx index 1ba36c37..e3c75e8b 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/modals/properties/index.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/properties/index.tsx @@ -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);