Skip to content

Commit d07a316

Browse files
authored
Merge pull request #2477 from airqo-platform/website-clean-air
Website: Remove glossary duplicate data
2 parents 69f478a + 0209490 commit d07a316

File tree

1 file changed

+8
-2
lines changed
  • website2/src/app/clean-air-forum/glossary

1 file changed

+8
-2
lines changed

website2/src/app/clean-air-forum/glossary/page.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ const GlossaryPage: React.FC = () => {
3636
const glossaryHTML = renderContent(selectedEvent.glossary_details);
3737
const showGlossaryMain = isValidGlossaryContent(glossaryHTML);
3838

39+
const glossarySections = selectedEvent.sections?.filter((section: any) => {
40+
if (!section.pages.includes('glossary')) return false;
41+
const html = renderContent(section.content);
42+
return html.trim().length > 0;
43+
});
44+
3945
return (
4046
<div className="px-4 lg:px-0 prose max-w-none flex flex-col gap-6">
4147
<Divider className="bg-black p-0 m-0 h-[1px] w-full" />
@@ -95,9 +101,9 @@ const GlossaryPage: React.FC = () => {
95101
)}
96102

97103
{/* Additional Glossary Sections (if any) */}
98-
{selectedEvent.sections && selectedEvent.sections.length > 0 && (
104+
{glossarySections && glossarySections.length > 0 && (
99105
<>
100-
{selectedEvent.sections.map((section: any) => (
106+
{glossarySections.map((section: any) => (
101107
<SectionDisplay key={section.id} section={section} />
102108
))}
103109
</>

0 commit comments

Comments
 (0)