fix: try to improve topic indication and loading

This commit is contained in:
Andy Burke 2025-10-08 19:55:28 -07:00
parent 4c1fa98418
commit ac64473749
2 changed files with 13 additions and 17 deletions

View file

@ -129,11 +129,12 @@
const topic_id = event?.detail?.topic_id ?? document.body.dataset.topic;
if (!topic_id) return;
const topic_chat_content = document.getElementById("topic-chat-content");
topic_chat_content.innerHTML = "";
const user = document.body.dataset.user ? JSON.parse(document.body.dataset.user) : null;
if (!user) return;
const topic_chat_content = document.getElementById("topic-chat-content");
if (topic_polling_request_abort_controller) {
topic_polling_request_abort_controller.abort();
topic_polling_request_abort_controller = null;
@ -149,8 +150,6 @@
const topic = await topic_response.json();
topic_chat_content.innerHTML = "";
const events_response = await api.fetch(
`/api/topics/${topic_id}/events?type=chat&limit=100&sort=newest`,
);