Skip to content

Commit

Permalink
Removed the persistent dot after removing duplicate extension
Browse files Browse the repository at this point in the history
  • Loading branch information
suubi-joshua committed Oct 25, 2024
1 parent 6338126 commit 02c9260
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const FilePreview: React.FC<FilePreviewProps> = ({
event.preventDefault();

const sanitizedFileName = allowedExtensions.reduce((name, ext) => {
const regex = new RegExp(`(${ext})+$`, 'i');
const regex = new RegExp(`\\.(${ext})+$`, 'i');
return name.replace(regex, '');
}, fileName);

Expand Down

0 comments on commit 02c9260

Please sign in to comment.