Force unique filename when saving files from multi-attachment msg
* Force unique filename when saving files from multi-attachment msg * Don't use attachment filenames if index is provided at all
This commit is contained in:
parent
e19067861e
commit
649544dfac
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import is from '@sindresorhus/is';
|
import is from '@sindresorhus/is';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { padStart } from 'lodash';
|
import { isNumber, padStart } from 'lodash';
|
||||||
|
|
||||||
import * as MIME from './MIME';
|
import * as MIME from './MIME';
|
||||||
import { arrayBufferToObjectURL } from '../util/arrayBufferToObjectURL';
|
import { arrayBufferToObjectURL } from '../util/arrayBufferToObjectURL';
|
||||||
|
@ -357,7 +357,7 @@ export const getSuggestedFilename = ({
|
||||||
timestamp?: number | Date;
|
timestamp?: number | Date;
|
||||||
index?: number;
|
index?: number;
|
||||||
}): string => {
|
}): string => {
|
||||||
if (attachment.fileName) {
|
if (!isNumber(index) && attachment.fileName) {
|
||||||
return attachment.fileName;
|
return attachment.fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue