From 2b82c61853e0f42d60ff421ca7d7dc1e289ecd87 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Wed, 24 Apr 2024 16:08:57 +0530 Subject: [PATCH] Inline --- .../services/upload/uploadCancelService.ts | 23 ----------------- .../src/services/upload/uploadManager.ts | 25 ++++++++++++++++++- 2 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 web/apps/photos/src/services/upload/uploadCancelService.ts diff --git a/web/apps/photos/src/services/upload/uploadCancelService.ts b/web/apps/photos/src/services/upload/uploadCancelService.ts deleted file mode 100644 index 790245784b..0000000000 --- a/web/apps/photos/src/services/upload/uploadCancelService.ts +++ /dev/null @@ -1,23 +0,0 @@ -interface UploadCancelStatus { - value: boolean; -} - -class UploadCancelService { - private shouldUploadBeCancelled: UploadCancelStatus = { - value: false, - }; - - reset() { - this.shouldUploadBeCancelled.value = false; - } - - requestUploadCancelation() { - this.shouldUploadBeCancelled.value = true; - } - - isUploadCancelationRequested(): boolean { - return this.shouldUploadBeCancelled.value; - } -} - -export default new UploadCancelService(); diff --git a/web/apps/photos/src/services/upload/uploadManager.ts b/web/apps/photos/src/services/upload/uploadManager.ts index 2b4844c142..9917ee8925 100644 --- a/web/apps/photos/src/services/upload/uploadManager.ts +++ b/web/apps/photos/src/services/upload/uploadManager.ts @@ -48,7 +48,6 @@ import { tryParseTakeoutMetadataJSON, type ParsedMetadataJSON, } from "./takeout"; -import uploadCancelService from "./uploadCancelService"; import UploadService, { assetName, getAssetName, @@ -59,6 +58,30 @@ import UploadService, { /** The number of uploads to process in parallel. */ const maxConcurrentUploads = 4; +interface UploadCancelStatus { + value: boolean; +} + +class UploadCancelService { + private shouldUploadBeCancelled: UploadCancelStatus = { + value: false, + }; + + reset() { + this.shouldUploadBeCancelled.value = false; + } + + requestUploadCancelation() { + this.shouldUploadBeCancelled.value = true; + } + + isUploadCancelationRequested(): boolean { + return this.shouldUploadBeCancelled.value; + } +} + +const uploadCancelService = new UploadCancelService(); + class UIService { private progressUpdater: ProgressUpdater;