diff --git a/public/index.html b/public/index.html
index 6721ebb..1ff9da7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -27,7 +27,6 @@
/* check if we are logged in */
(async () => {
try {
- console.log( 'hi');
const session_response = await api.fetch("/api/users/me");
if (!session_response.ok) {
diff --git a/public/tabs/talk.html b/public/tabs/talk.html
index 97f3752..822f1ef 100644
--- a/public/tabs/talk.html
+++ b/public/tabs/talk.html
@@ -190,9 +190,9 @@
return new_room_element;
}
+ const users = {};
async function append_room_events(events) {
const room_chat_content = document.getElementById("room-chat-content");
- const users = {};
let last_message_id = undefined;
for (const event of events) {
// if the last message is undefined, it becomes this event, otherwise, if this event's id is newer,
@@ -211,8 +211,12 @@
users[event.creator_id] =
users[event.creator_id] ??
- (await api.fetch(`/api/users/${event.creator_id}`));
+ (await (await api.fetch(`/api/users/${event.creator_id}`)).json());
+ console.dir({
+ users,
+ events,
+ });
room_chat_content.insertAdjacentHTML(
"beforeend",
render_text_event(event, users[event.creator_id]),
@@ -241,9 +245,11 @@
api.fetch(message_polling_url, {
signal: room_polling_request_abort_controller.signal,
})
- .then((new_events) => {
+ .then(async (new_events_response) => {
+ const new_events = await new_events_response.json();
console.dir({
room_id,
+ new_events_response,
new_events,
});
append_room_events(new_events);