Skip to content

armgit / ente

Public Imported from GitHub
0

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

refactor(photos):remove-slideshow-focus-restoration

Aswin Asok2b7f343034bf
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index dfd3816758..bfad032007 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -212,12 +212,9 @@ const Page: React.FC = () => {
files: EnteFile[];
title: string;
collectionID: number;
- restore: () => void;
}>();
const closeSlideshow = useCallback(() => setSlideshow(undefined), []);
- useEffect(() => slideshow?.restore, [slideshow]);
-
const [pendingFileNavigation, setPendingFileNavigation] = useState<{
fileIndex: number;
sidebar?: FileViewerInitialSidebar;
@@ -467,18 +464,10 @@ const Page: React.FC = () => {
});
return;
}
- const trigger = document.querySelector<HTMLButtonElement>(
- '[aria-controls="collection-options"]',
- );
setSlideshow({
files,
title: activeCollectionSummary?.name ?? activeCollection.name,
collectionID: activeCollection.id,
- restore: () => {
- requestAnimationFrame(() => {
- if (trigger?.isConnected) trigger.focus();
- });
- },
});
}, [
activeCollection,