Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(web): resolve lint and memory video autoplay review

AmanRajSinghMourya727915b8a5ee
diff --git a/web/apps/memories/src/pages/index.tsx b/web/apps/memories/src/pages/index.tsx
index b0bdbd611c..4f2bfc90ba 100644
--- a/web/apps/memories/src/pages/index.tsx
+++ b/web/apps/memories/src/pages/index.tsx
@@ -1323,12 +1323,12 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
setIsLoading(false);
onReadyRef.current?.();
const video = videoRef.current;
- if (video) {
+ if (video && !paused) {
video.play().catch(() => {
// Autoplay may be blocked.
});
}
- }, []);
+ }, [paused]);
const handleEnded = useCallback(() => {
onEndedRef.current?.();
diff --git a/web/packages/gallery/services/download.ts b/web/packages/gallery/services/download.ts
index ca8d97a5e1..fa027178df 100644
--- a/web/packages/gallery/services/download.ts
+++ b/web/packages/gallery/services/download.ts
@@ -954,9 +954,13 @@ const publicMemory_downloadFile = async (
`${customOrigin}/public-memory/files/download/${file.id}?${params.toString()}`,
);
} else {
- return fetch(await apiURL(`/public-memory/files/download/${file.id}`), {
- headers: authenticatedPublicMemoryRequestHeaders(credentials),
- });
+ return fetch(
+ await apiURL(`/public-memory/files/download/${file.id}`),
+ {
+ headers:
+ authenticatedPublicMemoryRequestHeaders(credentials),
+ },
+ );
}
};