Skip to content

Commit

Permalink
Fixed runtime error that occurs because, classList reading properties…
Browse files Browse the repository at this point in the history
… of NULL
  • Loading branch information
Vibgitcode27 committed Oct 11, 2023
1 parent 7ad4705 commit bab33fb
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/conference-website.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions components/Countdown/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ function Countdowns() {
dateRef.current.classList.add('home-title');
setSelectedIndex((prevIndex) => (prevIndex + 1) % dates.length);
setTimeout(() => {
locationRef.current.classList.remove('home-title');
locationRef.current.classList.add('hidden');
dateRef.current.classList.remove('home-title');
dateRef.current.classList.add('hidden');
if(locationRef.current) {
locationRef.current.classList.remove('home-title');
locationRef.current.classList.add('hidden');
}

if(dateRef.current) {
dateRef.current.classList.remove('home-title');
dateRef.current.classList.add('hidden');
}
}, 9900); // Element stays visible for 800 milliseconds
}, 10000); // Toggle visibility every 1500 milliseconds

Expand Down

0 comments on commit bab33fb

Please sign in to comment.