Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix public album detection for like button using credentials check

Anand Baburajanfd741c3729e5
diff --git a/web/packages/gallery/components/viewer/FileViewer.tsx b/web/packages/gallery/components/viewer/FileViewer.tsx
index 805dabf164..99d017c012 100644
--- a/web/packages/gallery/components/viewer/FileViewer.tsx
+++ b/web/packages/gallery/components/viewer/FileViewer.tsx
@@ -706,7 +706,11 @@ export const FileViewer: React.FC<FileViewerProps> = ({
// - If gallery view: show album selector (like) OR unlike selector/direct delete
// - If collection view: toggle like in that collection
const handleLikeClick = useCallback(() => {
- if (shouldOnlyServeAlbumsApp) {
+ // Detect public album: albums-only build OR we have public album credentials
+ const isPublicAlbum =
+ shouldOnlyServeAlbumsApp || !!publicAlbumsCredentials;
+
+ if (isPublicAlbum) {
const file = activeAnnotatedFileRef.current?.file;
if (!file || !publicAlbumsCredentials) {
setOpenPublicLikeModal(true);