diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index c3868c4f..bb108c86 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + #@ diff --git a/MovieVerse-Frontend/js/favorites.js b/MovieVerse-Frontend/js/favorites.js index 6e4206e5..133db635 100644 --- a/MovieVerse-Frontend/js/favorites.js +++ b/MovieVerse-Frontend/js/favorites.js @@ -1499,7 +1499,7 @@ async function displayFavoritesSection(titleText, items, displaySection) { if (items.length > 0) { const favoritesDiv = document.createElement('div'); favoritesDiv.className = 'watchlist'; - favoritesDiv.id = titleText.toLowerCase().replace(' ', '-'); + favoritesDiv.id = titleText.toLowerCase().replace(/\s+/g, '-'); const title = document.createElement('h3'); title.textContent = titleText; @@ -1509,8 +1509,10 @@ async function displayFavoritesSection(titleText, items, displaySection) { favoritesDiv.scrollIntoView({ behavior: 'smooth' }); }); + const titleTextNew = titleText === 'Favorite Movies' ? 'favorite movies' : 'favorite TV series'; + const description = document.createElement('p'); - description.textContent = `A collection of your ${titleText.toLowerCase()}.`; + description.textContent = `A collection of your ${titleTextNew}.`; description.className = 'watchlist-description'; favoritesDiv.appendChild(title); @@ -1527,8 +1529,9 @@ async function displayFavoritesSection(titleText, items, displaySection) { } else { const favoritesDiv = document.createElement('div'); favoritesDiv.className = 'watchlist'; - favoritesDiv.id = titleText.toLowerCase().replace(' ', '-'); - favoritesDiv.innerHTML = `

${titleText}

No ${titleText.toLowerCase()} added yet.

`; + favoritesDiv.id = titleText.toLowerCase().replace(/\s+/g, '-'); + const titleTextNew = titleText === 'Favorite Movies' ? 'favorite movies' : 'favorite TV series'; + favoritesDiv.innerHTML = `

${titleText}

No ${titleTextNew} added yet.

`; displaySection.appendChild(favoritesDiv); } }