fix "null" text appearing in modal
UPDATE: added {} in for-loop for readability - CK
Signed-off-by: Andy Chiang <redacted>
return null;
if (Array.isArray(children)) {
- for (let i = 0; i < children.length; i++)
+ for (let i = 0; i < children.length; i++) {
if (this.elem(children[i]))
node.appendChild(children[i]);
- else if (children !== null && children !== undefined)
+ else if (children[i] !== null && children[i] !== undefined)
node.appendChild(document.createTextNode(`${children[i]}`));
+ }
return node.lastChild;
}
if (info)
infoNode = E('p', _('%s').format(info));
- UI.prototype.showModal(_('Uploading file…'), [ progress, infoNode ? infoNode : null ]);
+ UI.prototype.showModal(_('Uploading file…'), [ progress, infoNode ]);
const data = new FormData();