forked from andyburke/autonomous.contact
fix: fix message submission
This commit is contained in:
parent
e52a9e997c
commit
6df0673c8e
3 changed files with 20 additions and 14 deletions
|
|
@ -349,7 +349,7 @@ async function append_topic_events(events) {
|
|||
let topic_polling_request_abort_controller = null;
|
||||
async function poll_for_new_events() {
|
||||
const topic_chat_content = document.getElementById("topic-chat-content");
|
||||
const topic_id = topic_chat_content.dataset.topic_id;
|
||||
const topic_id = document.body.dataset.topic;
|
||||
const last_message_id = topic_chat_content.dataset.last_message_id;
|
||||
|
||||
if (!topic_id) {
|
||||
|
|
@ -418,8 +418,8 @@ async function load_topic(topic_id) {
|
|||
const events = (await events_response.json()).reverse();
|
||||
|
||||
await append_topic_events(events);
|
||||
poll_for_new_events(topic_id);
|
||||
poll_for_new_events();
|
||||
}
|
||||
document.addEventListener("topic_changed", ({ detail: { topic } }) => {
|
||||
load_topic(topic);
|
||||
document.addEventListener("topic_changed", ({ detail: { topic_id } }) => {
|
||||
load_topic(topic_id);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue