fix: permission denied error and topic indicators

This commit is contained in:
Andy Burke 2025-09-12 15:26:13 -07:00
parent 50dcb98e0d
commit ce5cd81b10
3 changed files with 34 additions and 10 deletions

View file

@ -48,7 +48,6 @@
if ( !document.body.dataset.topic || document.body.dataset.topic !== topic_id ) {
const previous = document.body.dataset.topic;
document.body.dataset.topic = topic_id;
console.dir( {
topic_changed: {
@ -95,7 +94,10 @@
if ( first_topic_id ) {
window.location.hash = `/topic/${ first_topic_id }/chat`;
}
return;
}
document.body.dataset.topic = topic_id;
});
let TOPICS = [];
@ -117,9 +119,6 @@
try {
const topics_response = await api.fetch("/api/topics");
if (topics_response.ok) {
const topic_list = document.getElementById("topic-list");
topic_list.innerHTML = "";
const new_topics = await topics_response.json();
const has_differences = TOPICS.length !== new_topics.length || new_topics.some( (topic, index) => {
return ( TOPICS[ index ]?.id !== topic.id || TOPICS[ index ]?.name !== topic.name );