Skip to content

Commit

Permalink
Try that again
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludeck committed Aug 6, 2024
1 parent 0fe2d6d commit dedec48
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
27 changes: 14 additions & 13 deletions app/fng-jq-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,21 @@
const field = $scope.dataField(true);
// $scope.dataField(true) should always return something, but have seen a case in Sentry where it did not.
// surely a very rare case where they cancelled / redirected etc. at a very inopportune moment
if (field) {
const fileDetails = data.result.files[0];
const _id = fileDetails.id;
const filename = fileDetails.name;
const location = fileDetails.location;
const thumbnailId = fileDetails.thumbnailId;
field.push({
_id,
filename,
size: fileDetails.size,
location,
thumbnailId,
});
if (!field) {
return;
}
const fileDetails = data.result.files[0];
const _id = fileDetails.id;
const filename = fileDetails.name;
const location = fileDetails.location;
const thumbnailId = fileDetails.thumbnailId;
field.push({
_id,
filename,
size: fileDetails.size,
location,
thumbnailId,
});
// at the point of fileuploaddone being fired, the last item in $scope.$$childHead.queue will have already been
// populated with the details of the file provided by the server. we just need to decorate this now with the
// urls for downloading, deleting and retrieving a thumbnail for this item as setUpAttachments() isn't
Expand Down
29 changes: 15 additions & 14 deletions dist/fng-jq-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,21 @@
const field = $scope.dataField(true);
// $scope.dataField(true) should always return something, but have seen a case in Sentry where it did not.
// surely a very rare case where they cancelled / redirected etc. at a very inopportune moment
if (field) {
const fileDetails = data.result.files[0];
const _id = fileDetails.id;
const filename = fileDetails.name;
const location = fileDetails.location;
const thumbnailId = fileDetails.thumbnailId;
field.push({
_id,
filename,
size: fileDetails.size,
location,
thumbnailId,
});
if (!field) {
return;
}
const fileDetails = data.result.files[0];
const _id = fileDetails.id;
const filename = fileDetails.name;
const location = fileDetails.location;
const thumbnailId = fileDetails.thumbnailId;
field.push({
_id,
filename,
size: fileDetails.size,
location,
thumbnailId,
});
// at the point of fileuploaddone being fired, the last item in $scope.$$childHead.queue will have already been
// populated with the details of the file provided by the server. we just need to decorate this now with the
// urls for downloading, deleting and retrieving a thumbnail for this item as setUpAttachments() isn't
Expand All @@ -337,7 +338,7 @@
assignQueueToFormScope();
}
});
},
}
])
.directive('fngJqUploadForm', [
'PluginHelperService',
Expand Down
Loading

0 comments on commit dedec48

Please sign in to comment.