From 0a7991bc0ebb0a30f267a1c7705f796f7739e1b1 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 22 Mar 2024 19:52:08 +0530 Subject: [PATCH] Remove unused code --- web/apps/cast/src/services/readerService.ts | 35 ------------------- web/apps/photos/src/services/readerService.ts | 35 ------------------- 2 files changed, 70 deletions(-) diff --git a/web/apps/cast/src/services/readerService.ts b/web/apps/cast/src/services/readerService.ts index 344fd9f20..5aa42b6d2 100644 --- a/web/apps/cast/src/services/readerService.ts +++ b/web/apps/cast/src/services/readerService.ts @@ -56,38 +56,3 @@ async function* fileChunkReaderMaker(file: File, chunkSize: number) { } return null; } - -// depreciated -// eslint-disable-next-line @typescript-eslint/no-unused-vars -async function getUint8ArrayViewOld( - reader: FileReader, - file: Blob, -): Promise { - return await new Promise((resolve, reject) => { - reader.onabort = () => - reject( - Error( - `file reading was aborted, file size= ${convertBytesToHumanReadable( - file.size, - )}`, - ), - ); - reader.onerror = () => - reject( - Error( - `file reading has failed, file size= ${convertBytesToHumanReadable( - file.size, - )} , reason= ${reader.error}`, - ), - ); - reader.onload = () => { - // Do whatever you want with the file contents - const result = - typeof reader.result === "string" - ? new TextEncoder().encode(reader.result) - : new Uint8Array(reader.result); - resolve(result); - }; - reader.readAsArrayBuffer(file); - }); -} diff --git a/web/apps/photos/src/services/readerService.ts b/web/apps/photos/src/services/readerService.ts index 344fd9f20..5aa42b6d2 100644 --- a/web/apps/photos/src/services/readerService.ts +++ b/web/apps/photos/src/services/readerService.ts @@ -56,38 +56,3 @@ async function* fileChunkReaderMaker(file: File, chunkSize: number) { } return null; } - -// depreciated -// eslint-disable-next-line @typescript-eslint/no-unused-vars -async function getUint8ArrayViewOld( - reader: FileReader, - file: Blob, -): Promise { - return await new Promise((resolve, reject) => { - reader.onabort = () => - reject( - Error( - `file reading was aborted, file size= ${convertBytesToHumanReadable( - file.size, - )}`, - ), - ); - reader.onerror = () => - reject( - Error( - `file reading has failed, file size= ${convertBytesToHumanReadable( - file.size, - )} , reason= ${reader.error}`, - ), - ); - reader.onload = () => { - // Do whatever you want with the file contents - const result = - typeof reader.result === "string" - ? new TextEncoder().encode(reader.result) - : new Uint8Array(reader.result); - resolve(result); - }; - reader.readAsArrayBuffer(file); - }); -}