Skip to content

armgit / ente

Public Imported from GitHub
0

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

Revert "[web][photos] Discard stale Export authentication results"

Aswin Asok3ea090b8ec1d
diff --git a/web/apps/photos/src/components/sidebar/Sidebar.tsx b/web/apps/photos/src/components/sidebar/Sidebar.tsx
index c0785c7d81..5f1b694d66 100644
--- a/web/apps/photos/src/components/sidebar/Sidebar.tsx
+++ b/web/apps/photos/src/components/sidebar/Sidebar.tsx
@@ -117,14 +117,9 @@ export const Sidebar: React.FC<SidebarProps> = ({
const { show: showExport, props: exportVisibilityProps } =
useModalVisibility();
const { onClose: closeExport } = exportVisibilityProps;
- const exportAuthGeneration = useRef(0);
useEffect(() => {
if (!open) closeExport();
- return () => {
- // Discard authentication results after Sidebar closes or unmounts.
- exportAuthGeneration.current += 1;
- };
}, [open, closeExport]);
const { watchFolderView, setWatchFolderView } = usePhotosAppContext();
@@ -168,11 +163,9 @@ export const Sidebar: React.FC<SidebarProps> = ({
return;
}
- const authGeneration = exportAuthGeneration.current;
void (async () => {
try {
if (!(await onAuthenticateUser())) return;
- if (authGeneration !== exportAuthGeneration.current) return;
showExport();
} catch (error) {
log.error("Failed to authenticate before export", error);