mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-06 09:12:02 +00:00
Fix: Card has no favorite icon (#2203)
fixes the bug if the card has no favorite icon
This commit is contained in:
parent
e97cb9d49e
commit
84867a7ad7
@ -83,14 +83,16 @@ function syncFavorites() {
|
|||||||
cards.forEach(card => {
|
cards.forEach(card => {
|
||||||
const isFavorite = localStorage.getItem(card.id) === "favorite";
|
const isFavorite = localStorage.getItem(card.id) === "favorite";
|
||||||
const starIcon = card.querySelector(".favorite-icon span.material-symbols-rounded");
|
const starIcon = card.querySelector(".favorite-icon span.material-symbols-rounded");
|
||||||
if (isFavorite) {
|
if (starIcon) {
|
||||||
starIcon.classList.remove("no-fill");
|
if (isFavorite) {
|
||||||
starIcon.classList.add("fill");
|
starIcon.classList.remove("no-fill");
|
||||||
card.classList.add("favorite");
|
starIcon.classList.add("fill");
|
||||||
} else {
|
card.classList.add("favorite");
|
||||||
starIcon.classList.remove("fill");
|
} else {
|
||||||
starIcon.classList.add("no-fill");
|
starIcon.classList.remove("fill");
|
||||||
card.classList.remove("favorite");
|
starIcon.classList.add("no-fill");
|
||||||
|
card.classList.remove("favorite");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateFavoritesSection();
|
updateFavoritesSection();
|
||||||
@ -260,4 +262,4 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
showFavoritesOnly();
|
showFavoritesOnly();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user