Browse Source

Remove unused knob

Ref:
- https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties
Manav Rathi 1 year ago
parent
commit
b5096b02da

+ 1 - 4
web/apps/photos/src/services/download/clients/photos.ts

@@ -10,14 +10,11 @@ export class PhotosDownloadClient implements DownloadClient {
         private token: string,
         private token: string,
         private timeout: number,
         private timeout: number,
     ) {}
     ) {}
+
     updateTokens(token: string) {
     updateTokens(token: string) {
         this.token = token;
         this.token = token;
     }
     }
 
 
-    updateTimeout(timeout: number) {
-        this.timeout = timeout;
-    }
-
     async downloadThumbnail(file: EnteFile): Promise<Uint8Array> {
     async downloadThumbnail(file: EnteFile): Promise<Uint8Array> {
         if (!this.token) {
         if (!this.token) {
             throw Error(CustomError.TOKEN_MISSING);
             throw Error(CustomError.TOKEN_MISSING);

+ 0 - 4
web/apps/photos/src/services/download/clients/publicAlbums.ts

@@ -20,10 +20,6 @@ export class PublicAlbumsDownloadClient implements DownloadClient {
         this.passwordToken = passwordToken;
         this.passwordToken = passwordToken;
     }
     }
 
 
-    updateTimeout(timeout: number) {
-        this.timeout = timeout;
-    }
-
     downloadThumbnail = async (file: EnteFile) => {
     downloadThumbnail = async (file: EnteFile) => {
         if (!this.token) {
         if (!this.token) {
             throw Error(CustomError.TOKEN_MISSING);
             throw Error(CustomError.TOKEN_MISSING);

+ 2 - 11
web/apps/photos/src/services/download/index.ts

@@ -40,7 +40,6 @@ export type OnDownloadProgress = (event: {
 
 
 export interface DownloadClient {
 export interface DownloadClient {
     updateTokens: (token: string, passwordToken?: string) => void;
     updateTokens: (token: string, passwordToken?: string) => void;
-    updateTimeout: (timeout: number) => void;
     downloadThumbnail: (
     downloadThumbnail: (
         file: EnteFile,
         file: EnteFile,
         timeout?: number,
         timeout?: number,
@@ -77,13 +76,12 @@ class DownloadManagerImpl {
     async init(
     async init(
         app: APPS,
         app: APPS,
         tokens?: { token: string; passwordToken?: string } | { token: string },
         tokens?: { token: string; passwordToken?: string } | { token: string },
-        timeout?: number,
     ) {
     ) {
         if (this.ready) {
         if (this.ready) {
             log.info("DownloadManager already initialized");
             log.info("DownloadManager already initialized");
             return;
             return;
         }
         }
-        this.downloadClient = createDownloadClient(app, tokens, timeout);
+        this.downloadClient = createDownloadClient(app, tokens);
         try {
         try {
             this.thumbnailCache = await openCache("thumbs");
             this.thumbnailCache = await openCache("thumbs");
         } catch (e) {
         } catch (e) {
@@ -127,10 +125,6 @@ class DownloadManagerImpl {
         this.cryptoWorker = cryptoWorker;
         this.cryptoWorker = cryptoWorker;
     }
     }
 
 
-    updateTimeout(timeout: number) {
-        this.downloadClient.updateTimeout(timeout);
-    }
-
     setProgressUpdater(progressUpdater: (value: Map<number, number>) => void) {
     setProgressUpdater(progressUpdater: (value: Map<number, number>) => void) {
         this.progressUpdater = progressUpdater;
         this.progressUpdater = progressUpdater;
     }
     }
@@ -525,11 +519,8 @@ export default DownloadManager;
 function createDownloadClient(
 function createDownloadClient(
     app: APPS,
     app: APPS,
     tokens?: { token: string; passwordToken?: string } | { token: string },
     tokens?: { token: string; passwordToken?: string } | { token: string },
-    timeout?: number,
 ): DownloadClient {
 ): DownloadClient {
-    if (!timeout) {
-        timeout = 300000; // 5 minute
-    }
+    const timeout = 300000; // 5 minute
     if (app === APPS.ALBUMS) {
     if (app === APPS.ALBUMS) {
         if (!tokens) {
         if (!tokens) {
             tokens = { token: undefined, passwordToken: undefined };
             tokens = { token: undefined, passwordToken: undefined };