Fix: Card has no favorite icon (#2203)
fixes the bug if the card has no favorite icon
This commit is contained in:
@@ -83,6 +83,7 @@ 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 (starIcon) {
|
||||||
if (isFavorite) {
|
if (isFavorite) {
|
||||||
starIcon.classList.remove("no-fill");
|
starIcon.classList.remove("no-fill");
|
||||||
starIcon.classList.add("fill");
|
starIcon.classList.add("fill");
|
||||||
@@ -92,6 +93,7 @@ function syncFavorites() {
|
|||||||
starIcon.classList.add("no-fill");
|
starIcon.classList.add("no-fill");
|
||||||
card.classList.remove("favorite");
|
card.classList.remove("favorite");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
updateFavoritesSection();
|
updateFavoritesSection();
|
||||||
updateFavoritesDropdown();
|
updateFavoritesDropdown();
|
||||||
|
|||||||
Reference in New Issue
Block a user