Skip to content

Commit

Permalink
Fixed duplicate urlParams
Browse files Browse the repository at this point in the history
  • Loading branch information
YouFoundAlpha authored Sep 10, 2024
1 parent e0fd11a commit f103461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('search') && urlParams.get('search').trim() === '') {
window.location.href = '/'; // Redirect to the root URL if search parameter is empty
}

const container = document.querySelector('.container');
const defaultImage = "https://oyepriyansh.pages.dev/i/5nf5fd.png";
const searchInput = document.getElementById('searchInput'); // Assuming there's an input field for searching
Expand Down Expand Up @@ -149,7 +150,6 @@ document.getElementById("currentYear").textContent = new Date().getFullYear();
loadProfiles();

// Load search term from URL on page load
const urlParams = new URLSearchParams(window.location.search);
const searchTerm = urlParams.get('search') || '';
searchInput.value = searchTerm; // Set the input value from the URL
filterProfiles(searchTerm); // Filter profiles based on the URL search term

0 comments on commit f103461

Please sign in to comment.