FIX: Emoji uploader not using data.name on uppy upload (#14958)

When uploading emoji with the new uppy upload mixin, we were
not sending the name of the emoji in the payload, or more
accurately uppy was already using the file name as the name
value and we were not overriding it from data. This commit
changes the behaviour for single files uploaded via the uppy
upload mixin, by merging the file's meta object with this.data
from the parent component.
This commit is contained in:
Martin Brennan 2021-11-16 11:14:06 +10:00 committed by GitHub
parent 31035010af
commit f61783a218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -119,6 +119,13 @@ export default Mixin.create(UppyS3Multipart, {
this._reset();
return false;
}
// for a single file, we want to override file meta with the
// data property (which may be computed), to override any keys
// specified by this.data (such as name)
if (fileCount === 1) {
deepMerge(Object.values(files)[0].meta, this.data);
}
},
});