refactor(Attachment): :recycle: Simplify extension extraction to one line Removing temporary variable.

9bfb4163d37bffb239e3916d29297d1e670bc066

GregW6 <atlanticgreg1@gmail.com>

Signed
1 files changed, +1 -2Ignore whitespace
public/scripts/chats.js+1 -2
@@ -204,8 +204,7 @@ export async function populateFileAttachment(message, inputId = 'file_form_input
204 const fileNamePrefix = `${Date.now()}_${slug}`;204 const fileNamePrefix = `${Date.now()}_${slug}`;
205 const fileBase64 = await getBase64Async(file);205 const fileBase64 = await getBase64Async(file);
206 let base64Data = fileBase64.split(',')[1];206 let base64Data = fileBase64.split(',')[1];
207 const fileNameParts = file.name.split('.');207 const extension = file.name.substring((file.name.lastIndexOf('.') + file.name.length) % file.name.length + 1);
208 const extension = fileNameParts.length > 1 ? fileNameParts.at(-1) : '';
209208
210 // If file is image209 // If file is image
211 if (file.type.startsWith('image/')) {210 if (file.type.startsWith('image/')) {