fix: query selector for topics

pull/3813/head
Arik Chakma 2 years ago
parent a9d70f665b
commit a730c81886
  1. 4
      src/components/FrameRenderer/renderer.js
  2. 2
      src/components/TopicOverlay/topic.js

@ -44,7 +44,7 @@ export class Renderer {
return true;
}
async markToggleDone() {
async topicToggleDone() {
const { response, error } = await getUserResourceProgressApi({
resourceId: this.resourceId,
resourceType: this.resourceType,
@ -102,7 +102,7 @@ export class Renderer {
this.containerEl.innerHTML = `<div class="error py-5 text-center text-red-600 mx-auto">${message}</div>`;
}),
this.markToggleDone(),
this.topicToggleDone(),
]);
}

@ -113,7 +113,7 @@ export class Topic {
isTopicDone(topicId) {
const normalizedGroup = topicId.replace(/^\d+-/, '');
const el = document.querySelector(`[data-group-id="${normalizedGroup}"]`);
const el = document.querySelector(`[data-group-id$="-${normalizedGroup}"]`);
return el?.classList.contains('done');
}

Loading…
Cancel
Save