diff --git a/backend/static/app.js b/backend/static/app.js index d3b351f..9b652a8 100644 --- a/backend/static/app.js +++ b/backend/static/app.js @@ -7,6 +7,7 @@ class TranscriptionApp { this.ws = null; this.tasks = new Map(); this.currentFile = null; + this.renderTimeout = null; this.init(); } @@ -170,15 +171,18 @@ class TranscriptionApp { } renderTasks() { - const container = document.getElementById('tasksList'); - const tasks = Array.from(this.tasks.values()); + if (this.renderTimeout) clearTimeout(this.renderTimeout); + this.renderTimeout = setTimeout(() => { + const container = document.getElementById('tasksList'); + const tasks = Array.from(this.tasks.values()); - if (tasks.length === 0) { - container.innerHTML = '
Нет активных задач
'; - return; - } + if (tasks.length === 0) { + container.innerHTML = 'Нет активных задач
'; + return; + } - container.innerHTML = tasks.map(task => this.renderTaskItem(task)).join(''); + container.innerHTML = tasks.map(task => this.renderTaskItem(task)).join(''); + }, 100); } renderTaskItem(task) {