From a730c818863f72eaa91ebd14ed6583dfe041f5dd Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Tue, 11 Apr 2023 13:33:54 +0600 Subject: [PATCH] fix: query selector for topics --- src/components/FrameRenderer/renderer.js | 4 ++-- src/components/TopicOverlay/topic.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/FrameRenderer/renderer.js b/src/components/FrameRenderer/renderer.js index a5eb3ffc2..4c2daf87a 100644 --- a/src/components/FrameRenderer/renderer.js +++ b/src/components/FrameRenderer/renderer.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 = `
${message}
`; }), - this.markToggleDone(), + this.topicToggleDone(), ]); } diff --git a/src/components/TopicOverlay/topic.js b/src/components/TopicOverlay/topic.js index 6e368c683..02b6c7cd2 100644 --- a/src/components/TopicOverlay/topic.js +++ b/src/components/TopicOverlay/topic.js @@ -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'); }