Skip to content

Commit

Permalink
PR suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
minhaminha committed Sep 9, 2024
1 parent 3bf0501 commit 3990539
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions corehq/apps/cloudcare/static/cloudcare/js/form_entry/form_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -691,14 +691,16 @@ hqDefine("cloudcare/js/form_entry/form_ui", [
element.serverError(null);
}

const inputControl = [constants.CONTROL_IMAGE_CHOOSE, constants.CONTROL_LABEL,
constants.CONTROL_AUDIO_CAPTURE, constants.CONTROL_VIDEO_CAPTURE];

let findChildAndSetFilename = function (children) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
for (let child of children) {
if (child.children && child.children.length > 0) {
findChildAndSetFilename(child.children);
} else if (child.control >= constants.CONTROL_IMAGE_CHOOSE) {
} else if (inputControl.includes(child.control)) {
child.filename = element.answer();
break;
return;
}
}
};
Expand Down

0 comments on commit 3990539

Please sign in to comment.