Follow up - Remove all innerHTML += for consistency sake (#2159)

This commit is contained in:
Andrea Giammarchi
2024-09-11 15:12:04 +02:00
committed by GitHub
parent eb31e51a45
commit ee3cd76022

View File

@@ -91,9 +91,12 @@ async function execute({ currentTarget }) {
return envs.get(env).then((xworker) => { return envs.get(env).then((xworker) => {
xworker.onerror = ({ error }) => { xworker.onerror = ({ error }) => {
if (hasRunButton) { if (hasRunButton) {
outDiv.innerHTML += `<span style='color:red'>${ outDiv.insertAdjacentHTML(
"beforeend",
`<span style='color:red'>${
error.message || error error.message || error
}</span>\n`; }</span>\n`,
);
} }
console.error(error); console.error(error);
}; };
@@ -108,7 +111,10 @@ async function execute({ currentTarget }) {
}; };
sync.writeErr = (str) => { sync.writeErr = (str) => {
if (hasRunButton) { if (hasRunButton) {
outDiv.innerHTML += `<span style='color:red'>${str}</span>\n`; outDiv.insertAdjacentHTML(
"beforeend",
`<span style='color:red'>${str}</span>\n`,
);
} else { } else {
notify(str); notify(str);
console.error(str); console.error(str);