Skip to content

Commit 5ef5e8b

Browse files
committed
pr review: code cleanup
1 parent 55d7e62 commit 5ef5e8b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

extension/js/content_scripts/webmail/thunderbird/thunderbird-element-replacer.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,7 @@ export class ThunderbirdElementReplacer extends WebmailElementReplacer {
149149
const decryptedFileName = originalFilename.replace(/\.(pgp|gpg|asc)$/i, '');
150150
const uiFileExtensions = ['excel', 'word', 'png', 'jpg'];
151151
const matchedExtension = uiFileExtensions.find(fileExtension => decryptedFileName.endsWith(fileExtension));
152-
if (matchedExtension) {
153-
attachmentFileTypeIcon.attr('src', messenger.runtime.getURL(`/img/fileformat/${matchedExtension}.png`));
154-
} else {
155-
attachmentFileTypeIcon.attr('src', messenger.runtime.getURL(`/img/fileformat/generic.png`));
156-
}
152+
attachmentFileTypeIcon.attr('src', messenger.runtime.getURL(`/img/fileformat/${matchedExtension || 'generic'}.png`));
157153
const attachmentFilename = $('<div>').addClass('thunderbird_attachment_name').text(originalFilename);
158154
const attachmentDownloadBtn = $('<div>')
159155
.addClass('thunderbird_attachment_download')

0 commit comments

Comments
 (0)