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