diff --git a/web/apps/photos/src/components/WatchFolder.tsx b/web/apps/photos/src/components/WatchFolder.tsx index cc5a09223..49ad16e0d 100644 --- a/web/apps/photos/src/components/WatchFolder.tsx +++ b/web/apps/photos/src/components/WatchFolder.tsx @@ -1,4 +1,5 @@ import { ensureElectron } from "@/next/electron"; +import { FolderWatch } from "@/next/types/ipc"; import { FlexWrapper, HorizontalFlex, @@ -30,7 +31,6 @@ import { t } from "i18next"; import { AppContext } from "pages/_app"; import React, { useContext, useEffect, useState } from "react"; import watcher from "services/watch"; -import { WatchMapping as FolderWatch } from "types/watchFolder"; import { getImportSuggestion } from "utils/upload"; interface WatchFolderProps { @@ -85,11 +85,11 @@ export const WatchFolder: React.FC = ({ open, onClose }) => { if (analysisResult.hasNestedFolders) { setChoiceModalOpen(true); } else { - handleAddWatchMapping(UPLOAD_STRATEGY.SINGLE_COLLECTION, path); + addWatchWithStrategy(UPLOAD_STRATEGY.SINGLE_COLLECTION, path); } }; - const handleAddWatchMapping = async ( + const addWatchWithStrategy = async ( uploadStrategy: UPLOAD_STRATEGY, folderPath?: string, ) => { @@ -119,12 +119,12 @@ export const WatchFolder: React.FC = ({ open, onClose }) => { const uploadToSingleCollection = () => { closeChoiceModal(); - handleAddWatchMapping(UPLOAD_STRATEGY.SINGLE_COLLECTION); + addWatchWithStrategy(UPLOAD_STRATEGY.SINGLE_COLLECTION); }; const uploadToMultipleCollection = () => { closeChoiceModal(); - handleAddWatchMapping(UPLOAD_STRATEGY.COLLECTION_PER_FOLDER); + addWatchWithStrategy(UPLOAD_STRATEGY.COLLECTION_PER_FOLDER); }; return ( @@ -175,11 +175,11 @@ const WatchList: React.FC = ({ watches, removeWatch }) => { ) : ( - {watches.map((mapping) => { + {watches.map((watch) => { return ( ); @@ -198,7 +198,7 @@ const WatchesContainer = styled(Box)(() => ({ const NoWatches: React.FC = () => { return ( - + {t("NO_FOLDERS_ADDED")} @@ -219,11 +219,11 @@ const NoWatches: React.FC = () => { - + ); }; -const NoMappingsContainer = styled(VerticallyCentered)({ +const NoWatchesContainer = styled(VerticallyCentered)({ textAlign: "left", alignItems: "flex-start", marginBottom: "32px",