Skip to content

armgit / ente

Public Imported from GitHub
0

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

Auto debug

Manav Rathi18a0b18a1326
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index 121c10e5e8..216789f9b9 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -14,7 +14,7 @@ import {
getLocalFiles,
getLocalTrashedFiles,
} from "@/new/photos/services/files";
-import { wipHasSwitchedOnceCmpAndSet } from "@/new/photos/services/ml";
+import { wipClusterLocalOnce } from "@/new/photos/services/ml";
import type { Person } from "@/new/photos/services/ml/cgroups";
import {
filterSearchableFiles,
@@ -681,15 +681,7 @@ export default function Gallery() {
};
}, [selectAll, clearSelection]);
- useEffect(() => {
- // TODO-Cluster
- if (process.env.NEXT_PUBLIC_ENTE_WIP_CL_AUTO) {
- setTimeout(() => {
- if (!wipHasSwitchedOnceCmpAndSet())
- router.push("cluster-debug");
- }, 2000);
- }
- }, []);
+ useEffect(() => wipClusterLocalOnce(), []);
const fileToCollectionsMap = useMemoSingleThreaded(() => {
return constructFileToCollectionMap(files);
diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts
index 225c0891c6..a1aa1790c8 100644
--- a/web/packages/new/photos/services/ml/index.ts
+++ b/web/packages/new/photos/services/ml/index.ts
@@ -343,10 +343,11 @@ let _wip_peopleLocal: Person[] | undefined;
let _wip_peopleRemote: Person[] | undefined;
let _wip_hasSwitchedOnce = false;
-export const wipHasSwitchedOnceCmpAndSet = () => {
- if (_wip_hasSwitchedOnce) return true;
+export const wipClusterLocalOnce = () => {
+ if (!process.env.NEXT_PUBLIC_ENTE_WIP_CL_AUTO) return;
+ if (_wip_hasSwitchedOnce) return;
_wip_hasSwitchedOnce = true;
- return false;
+ void wipCluster();
};
export interface ClusterPreviewWithFile {