diff --git a/web/apps/photos/src/components/DeleteAccountModal.tsx b/web/apps/photos/src/components/DeleteAccountModal.tsx index 0e204afe3db45338741c94c7022a956d4e9169a0..744fbf3129a94eaac7211fdc1fec7e5e52b1be26 100644 --- a/web/apps/photos/src/components/DeleteAccountModal.tsx +++ b/web/apps/photos/src/components/DeleteAccountModal.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { logoutUser } from "@ente/accounts/services/user"; import DialogBoxV2 from "@ente/shared/components/DialogBoxV2"; import EnteButton from "@ente/shared/components/EnteButton"; diff --git a/web/apps/photos/src/components/MachineLearning/MLSearchSettings/index.tsx b/web/apps/photos/src/components/MachineLearning/MLSearchSettings/index.tsx index aab2ea67e16380f397bf63e292a7865dd941fd12..9b33a984a1a098da3e2ee91d6c56f23ec78a577f 100644 --- a/web/apps/photos/src/components/MachineLearning/MLSearchSettings/index.tsx +++ b/web/apps/photos/src/components/MachineLearning/MLSearchSettings/index.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { Box, DialogProps, Typography } from "@mui/material"; import { EnteDrawer } from "components/EnteDrawer"; import { t } from "i18next"; diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderCreationTime.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderCreationTime.tsx index 752f983d57d6da32cc940fdf9c0e0285ef80a922..9d5cad467c73cd360248ee9f90fabcc0ae8baa8d 100644 --- a/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderCreationTime.tsx +++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderCreationTime.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { FlexWrapper } from "@ente/shared/components/Container"; import { formatDate, formatTime } from "@ente/shared/time/format"; import CalendarTodayIcon from "@mui/icons-material/CalendarToday"; diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx index f5201bd74bc8a3ab421417ca5a2db3fa408ec17c..74ae87380f3825b249c4b386ad91fc3233731953 100644 --- a/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx +++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { FlexWrapper } from "@ente/shared/components/Container"; import PhotoOutlined from "@mui/icons-material/PhotoOutlined"; import VideocamOutlined from "@mui/icons-material/VideocamOutlined"; diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx index bd5a58d7e26502aed3e89110c1bb35d84ab26e81..997ad3d273847c57e633d71cbd759fbe7d5980ab 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { Backdrop, Box, diff --git a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx index c9f8c4a7d95a880159c5a5be5b91c0680b87dab8..6668fef1fa40d23203e14787d6845b2f2f3620a5 100644 --- a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx +++ b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import ChevronRight from "@mui/icons-material/ChevronRight"; import ScienceIcon from "@mui/icons-material/Science"; import { Box, DialogProps, Stack, Typography } from "@mui/material"; diff --git a/web/apps/photos/src/components/Sidebar/UtilitySection.tsx b/web/apps/photos/src/components/Sidebar/UtilitySection.tsx index 0d3f4b7fa94e58fd14392507cae7a83932c90653..904eab7474b578b127dc6cb235f5a780fe0c9e8b 100644 --- a/web/apps/photos/src/components/Sidebar/UtilitySection.tsx +++ b/web/apps/photos/src/components/Sidebar/UtilitySection.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import RecoveryKey from "@ente/shared/components/RecoveryKey"; import { ACCOUNTS_PAGES, diff --git a/web/apps/photos/src/components/Upload/Uploader.tsx b/web/apps/photos/src/components/Upload/Uploader.tsx index dca4f4f5189dac3cce30d7d3c5fdd5077a6bef9e..4d81b161224e3dad51c520903e73c8a091318c3d 100644 --- a/web/apps/photos/src/components/Upload/Uploader.tsx +++ b/web/apps/photos/src/components/Upload/Uploader.tsx @@ -1,4 +1,5 @@ import log from "@/next/log"; +import type { Electron } from "@/next/types/ipc"; import { CustomError } from "@ente/shared/error"; import { isPromise } from "@ente/shared/utils"; import DiscFullIcon from "@mui/icons-material/DiscFull"; diff --git a/web/apps/photos/src/components/pages/gallery/PlanSelector/card/index.tsx b/web/apps/photos/src/components/pages/gallery/PlanSelector/card/index.tsx index c9ba4338c2a328b7427241d7188ee80ef0219e2a..2ef3c361fdfc6ac85514130e51b5da31f6159212 100644 --- a/web/apps/photos/src/components/pages/gallery/PlanSelector/card/index.tsx +++ b/web/apps/photos/src/components/pages/gallery/PlanSelector/card/index.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { SUPPORT_EMAIL } from "@ente/shared/constants/urls"; import { useLocalState } from "@ente/shared/hooks/useLocalState"; import { LS_KEYS } from "@ente/shared/storage/localStorage"; diff --git a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx index f05059a7107a5b17b69afc5042e5944eff81347b..8704258f89a420f44d86ab5b895d897b5f3c22ea 100644 --- a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx +++ b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { Overlay } from "@ente/shared/components/Container"; import { CustomError } from "@ente/shared/error"; import useLongPress from "@ente/shared/hooks/useLongPress"; diff --git a/web/apps/photos/src/pages/index.tsx b/web/apps/photos/src/pages/index.tsx index eab09f1ed258a6657e091b4060e666356b10f32f..f2902008663bf4edcc00443f624399d92df822c0 100644 --- a/web/apps/photos/src/pages/index.tsx +++ b/web/apps/photos/src/pages/index.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import Login from "@ente/accounts/components/Login"; import SignUp from "@ente/accounts/components/SignUp"; import { APPS } from "@ente/shared/apps/constants"; diff --git a/web/apps/photos/src/pages/shared-albums/index.tsx b/web/apps/photos/src/pages/shared-albums/index.tsx index 30c2d1fb607d461b9bddf7d8d8e414677df61312..756377672cdf30978131cad9a32556ffb57898e7 100644 --- a/web/apps/photos/src/pages/shared-albums/index.tsx +++ b/web/apps/photos/src/pages/shared-albums/index.tsx @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { CenteredFlex, SpaceBetweenFlex, diff --git a/web/apps/photos/src/services/deduplicationService.ts b/web/apps/photos/src/services/deduplicationService.ts index 74267700574a91fc54fa114cee751bdf79a43f92..9d8ab399ff8efed0c60685c499eae4bf6384908c 100644 --- a/web/apps/photos/src/services/deduplicationService.ts +++ b/web/apps/photos/src/services/deduplicationService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import HTTPService from "@ente/shared/network/HTTPService"; import { getEndpoint } from "@ente/shared/network/api"; import { getToken } from "@ente/shared/storage/localStorage/helpers"; diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts index 70ebf2027d5f0b49058b408dd409a0ee8aaa456f..f2e90139a17a307a88419e08b32f0255223b18dd 100644 --- a/web/apps/photos/src/services/export/index.ts +++ b/web/apps/photos/src/services/export/index.ts @@ -1,3 +1,4 @@ +import { ensureElectron } from "@/next/electron"; import log from "@/next/log"; import { CustomError } from "@ente/shared/error"; import { Events, eventBus } from "@ente/shared/events"; diff --git a/web/apps/photos/src/services/heicConversionService.ts b/web/apps/photos/src/services/heicConversionService.ts index df89d8b0780182607dcb582c45472b1a6cd1b1c8..18978149460faaf0ea86ec59dd706c4bf4211b92 100644 --- a/web/apps/photos/src/services/heicConversionService.ts +++ b/web/apps/photos/src/services/heicConversionService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import WasmHEICConverterService from "./heic-convert/service"; class HeicConversionService { diff --git a/web/apps/photos/src/services/locationSearchService.ts b/web/apps/photos/src/services/locationSearchService.ts index caaec3c966e42115ccc43f9bc335b1630a9988cb..2aa2b6bacd11b75abbb25462591799666cde9ad3 100644 --- a/web/apps/photos/src/services/locationSearchService.ts +++ b/web/apps/photos/src/services/locationSearchService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { LocationTagData } from "types/entity"; import { Location } from "types/upload"; diff --git a/web/apps/photos/src/services/machineLearning/blazeFaceDetectionService.ts b/web/apps/photos/src/services/machineLearning/blazeFaceDetectionService.ts index 5c4f85405f1bd2edf2ac94b7c1642017bae4f830..615ed5b4c34b486e03ccda2083a0cbf2dfe91efd 100644 --- a/web/apps/photos/src/services/machineLearning/blazeFaceDetectionService.ts +++ b/web/apps/photos/src/services/machineLearning/blazeFaceDetectionService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { GraphModel } from "@tensorflow/tfjs-converter"; import * as tf from "@tensorflow/tfjs-core"; import { diff --git a/web/apps/photos/src/services/machineLearning/faceService.ts b/web/apps/photos/src/services/machineLearning/faceService.ts index 0186d7723699c27e3eed366f1e846b652c6f0f37..a5e20804d443821ea97ef76cd2a9308a1edccc2a 100644 --- a/web/apps/photos/src/services/machineLearning/faceService.ts +++ b/web/apps/photos/src/services/machineLearning/faceService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { DetectedFace, Face, diff --git a/web/apps/photos/src/services/machineLearning/imageSceneService.ts b/web/apps/photos/src/services/machineLearning/imageSceneService.ts index e82fa9439f08742b0d6908e7ee0cf5d3ccf486f2..d0ee6ec41483582e2aeb8ac3101bb9e1235282b8 100644 --- a/web/apps/photos/src/services/machineLearning/imageSceneService.ts +++ b/web/apps/photos/src/services/machineLearning/imageSceneService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import * as tfjsConverter from "@tensorflow/tfjs-converter"; import * as tf from "@tensorflow/tfjs-core"; import { SCENE_DETECTION_IMAGE_SIZE } from "constants/mlConfig"; diff --git a/web/apps/photos/src/services/machineLearning/machineLearningFactory.ts b/web/apps/photos/src/services/machineLearning/machineLearningFactory.ts index bc8978f61bf7a27f60069b56fc0410dbf2af6971..7edc381274eb98a36a1c607ec9bbd2db24492d3e 100644 --- a/web/apps/photos/src/services/machineLearning/machineLearningFactory.ts +++ b/web/apps/photos/src/services/machineLearning/machineLearningFactory.ts @@ -1,4 +1,5 @@ import { haveWindow } from "@/next/env"; +import log from "@/next/log"; import { ComlinkWorker } from "@/next/worker/comlink-worker"; import { getDedicatedCryptoWorker } from "@ente/shared/crypto"; import { DedicatedCryptoWorker } from "@ente/shared/crypto/internal/crypto.worker"; diff --git a/web/apps/photos/src/services/machineLearning/mobileFaceNetEmbeddingService.ts b/web/apps/photos/src/services/machineLearning/mobileFaceNetEmbeddingService.ts index 8798a91f9de7d74643c439b5575e88883114824d..4558823653355b66ef30216af199539c86438896 100644 --- a/web/apps/photos/src/services/machineLearning/mobileFaceNetEmbeddingService.ts +++ b/web/apps/photos/src/services/machineLearning/mobileFaceNetEmbeddingService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import * as tf from "@tensorflow/tfjs-core"; import { TFLiteModel } from "@tensorflow/tfjs-tflite"; import { MOBILEFACENET_FACE_SIZE } from "constants/mlConfig"; diff --git a/web/apps/photos/src/services/machineLearning/objectService.ts b/web/apps/photos/src/services/machineLearning/objectService.ts index ced6dfefb98873e11b16bacae7741cf20560da4b..97d7895a5d260925639be4acc91ec9436807b845 100644 --- a/web/apps/photos/src/services/machineLearning/objectService.ts +++ b/web/apps/photos/src/services/machineLearning/objectService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { DetectedObject, MLSyncContext, diff --git a/web/apps/photos/src/services/machineLearning/peopleService.ts b/web/apps/photos/src/services/machineLearning/peopleService.ts index d919c1d853e9b793441b01de3581b623c6077ab1..dbd2706bc7c63a93d20f27515a0c1ea78ef10ed3 100644 --- a/web/apps/photos/src/services/machineLearning/peopleService.ts +++ b/web/apps/photos/src/services/machineLearning/peopleService.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { Face, MLSyncContext, Person } from "types/machineLearning"; import { findFirstIfSorted, diff --git a/web/apps/photos/src/services/machineLearning/ssdMobileNetV2Service.ts b/web/apps/photos/src/services/machineLearning/ssdMobileNetV2Service.ts index fcba36f3a3137ef2432baafe1bfc07b7f71aba5d..186656532167f859985914702ed246a4468f4021 100644 --- a/web/apps/photos/src/services/machineLearning/ssdMobileNetV2Service.ts +++ b/web/apps/photos/src/services/machineLearning/ssdMobileNetV2Service.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import * as tf from "@tensorflow/tfjs-core"; import { ObjectDetection, diff --git a/web/apps/photos/src/utils/common/job.ts b/web/apps/photos/src/utils/common/job.ts index cfdf80ac85a3b8c1763cebb28458c303c6894d49..f549966b66999082fe42195a1dee33df35718f53 100644 --- a/web/apps/photos/src/utils/common/job.ts +++ b/web/apps/photos/src/utils/common/job.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { JobConfig, JobResult, JobState } from "types/common/job"; export class SimpleJob { diff --git a/web/apps/photos/src/utils/machineLearning/faceCrop.ts b/web/apps/photos/src/utils/machineLearning/faceCrop.ts index 5fcd2703e9565e3796a60917af645137f1335ddd..be0aa215d5a6f2658be94a669b7b2f8032374619 100644 --- a/web/apps/photos/src/utils/machineLearning/faceCrop.ts +++ b/web/apps/photos/src/utils/machineLearning/faceCrop.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { CacheStorageService } from "@ente/shared/storage/cacheStorage"; import { CACHES } from "@ente/shared/storage/cacheStorage/constants"; import { getBlobFromCache } from "@ente/shared/storage/cacheStorage/helpers"; diff --git a/web/apps/photos/src/utils/machineLearning/index.ts b/web/apps/photos/src/utils/machineLearning/index.ts index 51fea18afa914ba6d9a47c7597019ab6f1491d19..392b0fe9bdfd4643111db87c9c418cb4af974b14 100644 --- a/web/apps/photos/src/utils/machineLearning/index.ts +++ b/web/apps/photos/src/utils/machineLearning/index.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import { CACHES } from "@ente/shared/storage/cacheStorage/constants"; import { cached } from "@ente/shared/storage/cacheStorage/helpers"; import * as tf from "@tensorflow/tfjs-core"; diff --git a/web/packages/accounts/api/srp.ts b/web/packages/accounts/api/srp.ts index 8e47ab9de1f11a6949881da1daae0ff19cff4dd8..89dd8ab7d2d360756d5dec580552d3331e7ed89d 100644 --- a/web/packages/accounts/api/srp.ts +++ b/web/packages/accounts/api/srp.ts @@ -1,3 +1,4 @@ +import log from "@/next/log"; import HTTPService from "@ente/shared/network/HTTPService"; import { getEndpoint } from "@ente/shared/network/api"; diff --git a/web/packages/shared/components/Menu/EnteMenuItem.tsx b/web/packages/shared/components/Menu/EnteMenuItem.tsx index a3b6cb7b8d34cc133331ff2b29c8476e8a15ce15..087971d02c67a61318f7db34458af5e773629f15 100644 --- a/web/packages/shared/components/Menu/EnteMenuItem.tsx +++ b/web/packages/shared/components/Menu/EnteMenuItem.tsx @@ -12,18 +12,11 @@ import { import React from "react"; import { CaptionedText } from "../CaptionedText"; import PublicShareSwitch from "../Collections/CollectionShare/publicShare/switch"; -import ChangeDirectoryOption from "../Directory/changeOption"; interface Iprops { onClick: () => void; color?: ButtonProps["color"]; - variant?: - | "primary" - | "captioned" - | "toggle" - | "secondary" - | "mini" - | "path"; + variant?: "primary" | "captioned" | "toggle" | "secondary" | "mini"; fontWeight?: TypographyProps["fontWeight"]; startIcon?: React.ReactNode; endIcon?: React.ReactNode; @@ -49,14 +42,14 @@ export function EnteMenuItem({ disabled = false, }: Iprops) { const handleButtonClick = () => { - if (variant === "path" || variant === "toggle") { + if (variant === "toggle") { return; } onClick(); }; const handleIconClick = () => { - if (variant !== "path" && variant !== "toggle") { + if (variant !== "toggle") { return; } onClick(); @@ -116,11 +109,6 @@ export function EnteMenuItem({ onClick={handleIconClick} /> )} - {variant === "path" && ( - - )} diff --git a/web/packages/shared/crypto/helpers.ts b/web/packages/shared/crypto/helpers.ts index 6428311a2ae185cc70a4bea88eefed0cc7e14869..9250b4ab783576fcd1c8c3fc8286a138296aa4bb 100644 --- a/web/packages/shared/crypto/helpers.ts +++ b/web/packages/shared/crypto/helpers.ts @@ -1,4 +1,3 @@ -import ElectronAPIs from "@/next/electron"; import log from "@/next/log"; import { setRecoveryKey } from "@ente/accounts/api/user"; import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage"; @@ -6,7 +5,6 @@ import { getToken } from "@ente/shared/storage/localStorage/helpers"; import { SESSION_KEYS, setKey } from "@ente/shared/storage/sessionStorage"; import { getActualKey } from "@ente/shared/user"; import { KeyAttributes } from "@ente/shared/user/types"; -import isElectron from "is-electron"; import ComlinkCryptoWorker from "."; const LOGIN_SUB_KEY_LENGTH = 32; @@ -103,12 +101,9 @@ export const saveKeyInSessionStore = async ( const sessionKeyAttributes = await cryptoWorker.generateKeyAndEncryptToB64(key); setKey(keyType, sessionKeyAttributes); - if ( - isElectron() && - !fromDesktop && - keyType === SESSION_KEYS.ENCRYPTION_KEY - ) { - ElectronAPIs.setEncryptionKey(key); + const electron = globalThis.electron; + if (electron && !fromDesktop && keyType === SESSION_KEYS.ENCRYPTION_KEY) { + electron.setEncryptionKey(key); } };