From fe463c11af0cbd465884591e8ae055468e29e7fb Mon Sep 17 00:00:00 2001 From: lokses Date: Tue, 22 Sep 2026 12:45:34 +0300 Subject: [PATCH] =?UTF-8?q?chat:=20=D0=B2=D1=8B=D0=B7=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20chatInit=20=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20HTMX?= =?UTF-8?q?-=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Без этого список каналов зависал на «Загрузка…» при открытии чата из меню. Co-authored-by: Cursor --- static/assets/js/chat.js | 6 +++++- templates/index.html | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/static/assets/js/chat.js b/static/assets/js/chat.js index 8e47fd9..3c66dbf 100644 --- a/static/assets/js/chat.js +++ b/static/assets/js/chat.js @@ -306,8 +306,12 @@ function chatLoadChannels() { chatLoadLastActivity(); // уточнюємо порядок за реальним часом останніх постів }).catch(function (e) { console.error(e); + var msg = '
' + + gettext('Не удалось загрузить каналы') + '
'; var el = document.getElementById('chat-channel-list'); - if (el) el.innerHTML = '
' + gettext('Не удалось загрузить каналы') + '
'; + if (el) el.innerHTML = msg; + var dm = document.getElementById('chat-dm-list'); + if (dm) dm.innerHTML = msg; }); } diff --git a/templates/index.html b/templates/index.html index 0333bdc..857f239 100644 --- a/templates/index.html +++ b/templates/index.html @@ -907,6 +907,11 @@ if (typeof ttInit === 'function') ttInit(); if (typeof hrPortalInit === 'function') hrPortalInit(); if (typeof empProfileInit === 'function') empProfileInit(); + // Чат: inline в HTMX-swap часто не выполняется — + // без этого списка каналов зависает на «Загрузка…». + if (typeof chatInit === 'function' && document.getElementById('chat-config-data')) { + chatInit(); + } });