mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 17:08:57 +01:00
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:
committed by
Ken Powers
parent
e19067861e
commit
649544dfac
@@ -1,6 +1,6 @@
|
||||
import is from '@sindresorhus/is';
|
||||
import moment from 'moment';
|
||||
import { padStart } from 'lodash';
|
||||
import { isNumber, padStart } from 'lodash';
|
||||
|
||||
import * as MIME from './MIME';
|
||||
import { arrayBufferToObjectURL } from '../util/arrayBufferToObjectURL';
|
||||
@@ -357,7 +357,7 @@ export const getSuggestedFilename = ({
|
||||
timestamp?: number | Date;
|
||||
index?: number;
|
||||
}): string => {
|
||||
if (attachment.fileName) {
|
||||
if (!isNumber(index) && attachment.fileName) {
|
||||
return attachment.fileName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user