diff --git a/desktop/src/main/stores/watch.ts b/desktop/src/main/stores/watch.ts index e4b2efa7a..ee077bbcd 100644 --- a/desktop/src/main/stores/watch.ts +++ b/desktop/src/main/stores/watch.ts @@ -1,44 +1,34 @@ import Store, { Schema } from "electron-store"; import { type FolderWatch } from "../../types/ipc"; -interface WatchStoreSchema { +interface WatchStore { mappings: FolderWatch[]; } -const watchStoreSchema: Schema = { +const watchStoreSchema: Schema = { mappings: { type: "array", items: { type: "object", properties: { - rootFolderName: { - type: "string", - }, - uploadStrategy: { - type: "number", - }, - folderPath: { - type: "string", - }, + rootFolderName: { type: "string" }, + collectionMapping: { type: "string" }, + uploadStrategy: { type: "number" }, + folderPath: { type: "string" }, syncedFiles: { type: "array", items: { type: "object", properties: { - path: { - type: "string", - }, - id: { - type: "number", - }, + path: { type: "string" }, + uploadedFileID: { type: "string" }, + collectionID: { type: "string" }, }, }, }, ignoredFiles: { type: "array", - items: { - type: "string", - }, + items: { type: "string" }, }, }, }, diff --git a/desktop/src/types/ipc.ts b/desktop/src/types/ipc.ts index 1d330dc6f..2c137f4b7 100644 --- a/desktop/src/types/ipc.ts +++ b/desktop/src/types/ipc.ts @@ -11,12 +11,14 @@ export interface AppUpdate { } export interface FolderWatch { + // TODO(MR): Is this needed rootFolderName: string; - uploadStrategy: number; + collectionMapping: CollectionMapping; folderPath: string; syncedFiles: FolderWatchSyncedFile[]; ignoredFiles: string[]; } +export type CollectionMapping = "root" | "parent"; export interface FolderWatchSyncedFile { path: string;