Skip to content

Commit

Permalink
Fix #1786
Browse files Browse the repository at this point in the history
  • Loading branch information
danialfaridsada committed Mar 4, 2017
1 parent 12336a0 commit dadf63c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ ngFileUpload.service('Upload', ['$parse', '$timeout', '$compile', '$q', 'UploadE
if (validateAfterResize) {
upload.validate(allNewFiles, keep ? prevValidFiles.length : 0, ngModel, attr, scope)
.then(function (validationResult) {
valids = validationResult.validsFiles;
invalids = validationResult.invalidsFiles;
valids = validationResult.validFiles;
invalids = validationResult.invalidFiles;
updateModel();
});
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,14 @@ ngFileUpload.service('UploadValidate', ['UploadDataUrl', '$q', '$timeout', funct

el.on('loadedmetadata', success);
el.on('error', error);

var count = 0;

function checkLoadError() {
$timeout(function () {
if (el[0].parentNode) {
if (el[0].duration) {
success();
} else if (count > 10) {
} else if (count++ > 10) {
error();
} else {
checkLoadError();
Expand Down

0 comments on commit dadf63c

Please sign in to comment.