@ -361,7 +361,12 @@ export const getSuggestedFilenameSending = ({
export const getFileExtension = ( attachment : AttachmentType ) : string | undefined = > {
export const getFileExtension = ( attachment : AttachmentType ) : string | undefined = > {
// we override textplain to the extension of the file
// we override textplain to the extension of the file
if ( ! attachment . contentType || attachment . contentType === 'text/plain' ) {
// for contenttype starting with application, the mimetype is probably wrong so just use the extension of the file instead
if (
! attachment . contentType ||
attachment . contentType === 'text/plain' ||
attachment . contentType . startsWith ( 'application' )
) {
if ( attachment . fileName ? . length ) {
if ( attachment . fileName ? . length ) {
const dotLastIndex = attachment . fileName . lastIndexOf ( '.' ) ;
const dotLastIndex = attachment . fileName . lastIndexOf ( '.' ) ;
if ( dotLastIndex !== - 1 ) {
if ( dotLastIndex !== - 1 ) {