diff --git a/src/components/Sponsor/sponsor.js b/src/components/Sponsor/sponsor.js index 8390791e1..3d3975610 100644 --- a/src/components/Sponsor/sponsor.js +++ b/src/components/Sponsor/sponsor.js @@ -1,12 +1,12 @@ import { sponsorHidden } from '../../stores/page'; -function showHideSponsor(isHidden) { +function showHideSponsor(shouldHide) { const ad = document.querySelector('#sponsor-ad'); if (!ad) { return; } - if (isHidden) { + if (shouldHide) { ad.classList.add('hidden'); ad.classList.remove('flex'); } else { diff --git a/src/components/TopicDetail/TopicDetail.tsx b/src/components/TopicDetail/TopicDetail.tsx index cc5258fc9..a096c9cb5 100644 --- a/src/components/TopicDetail/TopicDetail.tsx +++ b/src/components/TopicDetail/TopicDetail.tsx @@ -84,7 +84,6 @@ export function TopicDetail() { // Close the topic detail when user clicks outside the topic detail useOutsideClick(topicRef, () => { setIsActive(false); - sponsorHidden.set(false); }); useKeydown('Escape', () => {