fix: try to ensure chat and blurbs load properly initially
This commit is contained in:
parent
f35fe395c6
commit
8b70172493
2 changed files with 7 additions and 6 deletions
|
|
@ -144,6 +144,8 @@
|
|||
<div id="blurbs-container" class="container">
|
||||
<!-- #include file="./README.md" -->
|
||||
|
||||
<!-- #include file="./new_blurb.html" -->
|
||||
|
||||
<div id="blurbs-list"></div>
|
||||
<script>
|
||||
const blurbs_list = document.getElementById("blurbs-list");
|
||||
|
|
@ -247,8 +249,8 @@
|
|||
});
|
||||
}
|
||||
|
||||
async function load_active_topic_for_blurbs() {
|
||||
const topic_id = document.body.dataset.topic;
|
||||
async function load_active_topic_for_blurbs(event) {
|
||||
const topic_id = event?.detail?.topic_id ?? document.body.dataset.topic;
|
||||
if (!topic_id) return;
|
||||
|
||||
const user = document.body.dataset.user
|
||||
|
|
@ -292,11 +294,10 @@
|
|||
|
||||
poll_for_new_blurbs();
|
||||
}
|
||||
|
||||
document.addEventListener("topic_changed", load_active_topic_for_blurbs);
|
||||
document.addEventListener("user_logged_in", load_active_topic_for_blurbs);
|
||||
</script>
|
||||
|
||||
<!-- #include file="./new_blurb.html" -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -125,8 +125,8 @@
|
|||
});
|
||||
}
|
||||
|
||||
async function load_active_topic_for_chat() {
|
||||
const topic_id = document.body.dataset.topic;
|
||||
async function load_active_topic_for_chat(event) {
|
||||
const topic_id = event?.detail?.topic_id ?? document.body.dataset.topic;
|
||||
if (!topic_id) return;
|
||||
|
||||
const user = document.body.dataset.user ? JSON.parse(document.body.dataset.user) : null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue