diff --git a/web/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx b/web/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx index f23826c00..8a5cb2c90 100644 --- a/web/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx +++ b/web/apps/photos/src/components/Collections/CollectionOptions/AlbumCastDialog.tsx @@ -132,7 +132,7 @@ export default function AlbumCastDialog(props: Props) { session .sendMessage("urn:x-cast:pair-request", {}) .then(() => { - log.debug("Message sent successfully"); + log.debug(() => "Message sent successfully"); }) .catch((e) => { log.error("Error sending message", e); diff --git a/web/apps/photos/src/services/machineLearning/mlWorkManager.ts b/web/apps/photos/src/services/machineLearning/mlWorkManager.ts index ee66a3399..47bd602c0 100644 --- a/web/apps/photos/src/services/machineLearning/mlWorkManager.ts +++ b/web/apps/photos/src/services/machineLearning/mlWorkManager.ts @@ -1,8 +1,8 @@ +import { ComlinkWorker } from "@/next/worker/comlink-worker"; import { eventBus, Events } from "@ente/shared/events"; import { addLogLine } from "@ente/shared/logging"; import { logError } from "@ente/shared/sentry"; import { getToken, getUserID } from "@ente/shared/storage/localStorage/helpers"; -import { ComlinkWorker } from "@/next/worker/comlink-worker"; import { FILE_TYPE } from "constants/file"; import debounce from "debounce"; import PQueue from "p-queue"; diff --git a/web/apps/photos/src/services/upload/uploadManager.ts b/web/apps/photos/src/services/upload/uploadManager.ts index b8a7aff29..ec9163201 100644 --- a/web/apps/photos/src/services/upload/uploadManager.ts +++ b/web/apps/photos/src/services/upload/uploadManager.ts @@ -25,10 +25,10 @@ import UploadService from "./uploadService"; import uploader from "./uploader"; import { getFileNameSize } from "@/next/file"; +import { ComlinkWorker } from "@/next/worker/comlink-worker"; import { getDedicatedCryptoWorker } from "@ente/shared/crypto"; import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker"; import { addLogLine } from "@ente/shared/logging"; -import { ComlinkWorker } from "@/next/worker/comlink-worker"; import { Remote } from "comlink"; import { UPLOAD_RESULT, UPLOAD_STAGES } from "constants/upload"; import isElectron from "is-electron"; diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.ts index 7558f5f29..a0c13a48a 100644 --- a/web/apps/photos/src/utils/file/index.ts +++ b/web/apps/photos/src/utils/file/index.ts @@ -1,13 +1,13 @@ import ElectronAPIs from "@/next/electron"; import { convertBytesToHumanReadable } from "@/next/file"; import log from "@/next/log"; +import { workerBridge } from "@/next/worker/worker-bridge"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import { CustomError } from "@ente/shared/error"; import { isPlaybackPossible } from "@ente/shared/media/video-playback"; import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; import { User } from "@ente/shared/user/types"; import { downloadUsingAnchor } from "@ente/shared/utils"; -import { workerBridge } from "@ente/shared/worker/worker-bridge"; import { FILE_TYPE, RAW_FORMATS, @@ -489,10 +489,9 @@ const convertToJPEGInElectron = async ( try { const startTime = Date.now(); const inputFileData = new Uint8Array(await fileBlob.arrayBuffer()); - const convertedFileData = await workerBridge.convertToJPEG( - inputFileData, - filename, - ); + const convertedFileData = isElectron() + ? await ElectronAPIs.convertToJPEG(inputFileData, filename) + : await workerBridge.convertToJPEG(inputFileData, filename); log.info( `originalFileSize:${convertBytesToHumanReadable( fileBlob?.size,