Fix crash in the LogsViewer accessing non-existing nodes

This commit is contained in:
Johannes Zellner
2025-12-12 16:02:38 +01:00
parent 854fbe53be
commit 6e011ae70e

View File

@@ -119,12 +119,12 @@ export default {
let newLogLines = [];
const tmp = document.getElementsByClassName('pankow-main-layout-body')[0];
setInterval(() => {
this.refreshInterval = setInterval(() => {
newLogLines = newLogLines.slice(-maxLines);
for (const line of newLogLines) {
if (lines < maxLines) ++lines;
else this.$refs.linesContainer.removeChild(this.$refs.linesContainer.firstChild);
else if (this.$refs.linesContainer.firstChild) this.$refs.linesContainer.removeChild(this.$refs.linesContainer.firstChild);
const logLine = document.createElement('div');
logLine.className = 'log-line';
@@ -143,6 +143,9 @@ export default {
}, function (error) {
newLogLines.push({ time: error.time, html: error.html });
});
},
unmounted() {
clearInterval(this.refreshInterval);
}
};