Skip to content

Commit

Permalink
send file object to state and read bianaries and hashes outside of re…
Browse files Browse the repository at this point in the history
…act #2766
  • Loading branch information
Josh Pollock committed Oct 25, 2018
1 parent 200bfb7 commit 791beab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions clients/render/build/index.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -23235,7 +23235,7 @@ Object(__WEBPACK_IMPORTED_MODULE_4__wordpress_dom_ready__["a" /* default */])(fu
if ('file' === field.type) {
var verify = jQuery("#_cf_verify_" + field.formId).val();
var hashes = [];
var bianaries = [];
var binaries = [];
var files = [values[fieldId]];

files.forEach(function (file) {
Expand All @@ -23246,14 +23246,14 @@ Object(__WEBPACK_IMPORTED_MODULE_4__wordpress_dom_ready__["a" /* default */])(fu
readerForHashes.readAsArrayBuffer(file);
var readerForBianary = new FileReader();
readerForBianary.onload = function () {
bianaries.push(readerForHashes.result);
binaries.push(readerForHashes.result);
};

readerForBianary.readAsBinaryString(file);
});

var data = {
files: bianaries,
files: binaries,
hashes: hashes,
verify: verify,
formId: field.formId,
Expand Down
2 changes: 1 addition & 1 deletion clients/render/build/index.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions clients/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ domReady(function () {
if ('file' === field.type) {
const verify = jQuery(`#_cf_verify_${field.formId}`).val();
const hashes = [];
const bianaries = [];
const binaries = [];
const files = [values[fieldId]];

files.forEach(file => {
Expand All @@ -94,15 +94,15 @@ domReady(function () {
readerForHashes.readAsArrayBuffer(file);
var readerForBianary = new FileReader();
readerForBianary.onload = () => {
bianaries.push( readerForHashes.result );
binaries.push( readerForHashes.result );
};

readerForBianary.readAsBinaryString(file);

});

const data = {
files: bianaries,
files: binaries,
hashes,
verify,
formId: field.formId,
Expand Down

0 comments on commit 791beab

Please sign in to comment.