diff --git a/visi.js b/visi.js index 37a9da49..4e414367 100644 --- a/visi.js +++ b/visi.js @@ -5,9 +5,14 @@ function getVisitorCount() { // Function to increment and save the count function incrementVisitorCount() { - let count = parseInt(getVisitorCount()) + 1; - localStorage.setItem('visitorCount', count); - return count; + if (!localStorage.getItem('visitedHomePage')) { + let count = parseInt(getVisitorCount()) + 1; + localStorage.setItem('visitorCount', count); + localStorage.setItem('visitedHomePage', 'true'); + return count; + } + + return getVisitorCount(); } // Function to display the count