Remove console logs and clean up code

This commit is contained in:
dertyp7
2024-01-14 22:29:11 +01:00
parent 0c05e4273c
commit e934efe04a
2 changed files with 1 additions and 7 deletions

View File

@@ -33,16 +33,10 @@ export default function App() {
(entries) => { (entries) => {
entries.forEach((entry) => { entries.forEach((entry) => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
// console.log("====================================");
// console.log(`Previous Hash: ${prevHash.current}`);
// console.log(`Current Hash: ${window.location.hash}`);
// console.log(`Target ID: ${entry.target.id}`);
const difference = Math.abs( const difference = Math.abs(
sections.indexOf(prevHash.current.replace("#", "")) - sections.indexOf(prevHash.current.replace("#", "")) -
sections.indexOf(window.location.hash.replace("#", "")) sections.indexOf(window.location.hash.replace("#", ""))
); );
// console.log(`Difference: ${difference}`);
if (difference > 1) { if (difference > 1) {
prevHash.current = entry.target.id; prevHash.current = entry.target.id;
return; return;

View File

@@ -12,7 +12,7 @@ export default function About() {
setJob(jobs[jobIndex]); setJob(jobs[jobIndex]);
}, 7000); }, 7000);
return () => clearInterval(intervalId); // Clean up on unmount return () => clearInterval(intervalId);
}, []); }, []);
return ( return (