Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prune

Manav Rathi020d73f04d27
diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx
index da95719921..627b2cc985 100644
--- a/web/apps/photos/src/pages/_app.tsx
+++ b/web/apps/photos/src/pages/_app.tsx
@@ -21,7 +21,6 @@ import {
} from "@/new/photos/components/utils/download";
import { useLoadingBar } from "@/new/photos/components/utils/use-loading-bar";
import { photosDialogZIndex } from "@/new/photos/components/utils/z-index";
-import DownloadManager from "@/new/photos/services/download";
import { runMigrations } from "@/new/photos/services/migrations";
import { initML, isMLSupported } from "@/new/photos/services/ml";
import { getFamilyPortalRedirectURL } from "@/new/photos/services/user-details";
@@ -34,7 +33,6 @@ import {
getData,
migrateKVToken,
} from "@ente/shared/storage/localStorage";
-import { getToken } from "@ente/shared/storage/localStorage/helpers";
import { getTheme } from "@ente/shared/themes";
import { THEME_COLOR } from "@ente/shared/themes/constants";
import type { User } from "@ente/shared/user/types";
@@ -127,16 +125,7 @@ export default function App({ Component, pageProps }: AppProps) {
}, []);
useEffect(() => {
- if (!isDesktop) {
- return;
- }
- const initExport = async () => {
- const token = getToken();
- if (!token) return;
- await DownloadManager.init(token);
- await resumeExportsIfNeeded();
- };
- initExport();
+ if (isDesktop) void resumeExportsIfNeeded();
}, []);
const setUserOnline = () => setOffline(false);
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index f190f2cc81..56125b68e1 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -35,7 +35,6 @@ import {
isHiddenCollection,
} from "@/new/photos/services/collection";
import { areOnlySystemCollections } from "@/new/photos/services/collection/ui";
-import downloadManager from "@/new/photos/services/download";
import {
getLocalFiles,
getLocalTrashedFiles,
@@ -351,7 +350,6 @@ export default function Gallery() {
}
initSettings();
await initUserDetailsOrTriggerSync();
- await downloadManager.init(token);
setupSelectAllKeyBoardShortcutHandler();
dispatch({ type: "showAll" });
setIsFirstLoad(isFirstLogin());
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx
index 47e48c3eaf..05de541503 100644
--- a/web/apps/photos/src/pages/shared-albums.tsx
+++ b/web/apps/photos/src/pages/shared-albums.tsx
@@ -223,7 +223,6 @@ export default function PublicCollectionGallery() {
let redirectingToWebsite = false;
try {
const cryptoWorker = await sharedCryptoWorker();
- await downloadManager.init();
url.current = window.location.href;
const currentURL = new URL(url.current);
diff --git a/web/packages/new/photos/services/download.ts b/web/packages/new/photos/services/download.ts
index 2d2bf72eba..1487edfcdb 100644
--- a/web/packages/new/photos/services/download.ts
+++ b/web/packages/new/photos/services/download.ts
@@ -58,8 +58,6 @@ export interface SourceURLs {
}
class DownloadManagerImpl {
- // TODO: Temporary
- private token: string | undefined;
/**
* Credentials that should be used to download files when we're in the
* context of the public albums app.
@@ -111,10 +109,6 @@ class DownloadManagerImpl {
private fileDownloadProgress = new Map<number, number>();
private fileDownloadProgressListeners: (() => void)[] = [];
- async init(token?: string) {
- await this.initThumbnailCacheIfNeeded();
- }
-
private async initThumbnailCacheIfNeeded() {
if (this.thumbnailCache === undefined) {
try {
diff --git a/web/packages/new/photos/services/ml/worker.ts b/web/packages/new/photos/services/ml/worker.ts
index 1e91c974b6..16fab74349 100644
--- a/web/packages/new/photos/services/ml/worker.ts
+++ b/web/packages/new/photos/services/ml/worker.ts
@@ -2,13 +2,11 @@ import { clientPackageName } from "@/base/app";
import { assertionFailed } from "@/base/assert";
import { isHTTP4xxError } from "@/base/http";
import { getKVN } from "@/base/kv";
-import { ensureAuthToken } from "@/base/local-user";
import log from "@/base/log";
import type { ElectronMLWorker } from "@/base/types/ipc";
import { fileLogID, type EnteFile } from "@/media/file";
import { wait } from "@/utils/promise";
import { expose, wrap } from "comlink";
-import downloadManager from "../download";
import { getAllLocalFiles, getLocalTrashedFiles } from "../files";
import type { UploadItem } from "../upload/types";
import {
@@ -130,12 +128,9 @@ export class MLWorker {
* @param delegate The {@link MLWorkerDelegate} the worker can use to inform
* the main thread of interesting events.
*/
- async init(port: MessagePort, delegate: MLWorkerDelegate) {
+ init(port: MessagePort, delegate: MLWorkerDelegate) {
this.electron = wrap<ElectronMLWorker>(port);
this.delegate = delegate;
- // Initialize the downloadManager running in the web worker with the
- // user's token. It'll be used to download files to index if needed.
- await downloadManager.init(await ensureAuthToken());
}
/**