This commit is contained in:
Manav Rathi
2025-03-17 15:43:21 +05:30
parent d032df105b
commit 89b8e98cd2

View File

@@ -639,10 +639,11 @@ export class FileViewerPhotoSwipe {
button.disabled = pendingFavoriteUpdates.has(af.file.id);
// Update the fill visibility based on the favorite status.
showIf(
document.getElementById("pswp__icn-favorite-fill")!,
!!delegate.isFavorite(af),
);
const fill = document.getElementById("pswp__icn-favorite-fill");
if (fill) {
// Need a null check since we might've been closed meanwhile.
showIf(fill, !!delegate.isFavorite(af));
}
};
const handleToggleFavorite = () => void toggleFavorite();