From e83539bb485411d41c70071ebf7043b9f3b83084 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 22 Mar 2025 20:31:48 +0000 Subject: [PATCH] Inject deps --- frontend/sync-client/src/sync-client.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/frontend/sync-client/src/sync-client.ts b/frontend/sync-client/src/sync-client.ts index 1d23399c..93998d9d 100644 --- a/frontend/sync-client/src/sync-client.ts +++ b/frontend/sync-client/src/sync-client.ts @@ -14,6 +14,7 @@ import { Syncer } from "./sync-operations/syncer"; import type { FileSystemOperations } from "./file-operations/filesystem-operations"; import { FileOperations } from "./file-operations/file-operations"; import { ConnectionStatus } from "./services/connection-status"; +import { UnrestrictedSyncer } from "./sync-operations/unrestricted-syncer"; export class SyncClient { private remoteListenerIntervalId: NodeJS.Timeout | null = null; @@ -41,11 +42,6 @@ export class SyncClient { if (newSettings.vaultName !== oldSettings.vaultName) { void this.reset(); - } else if ( - newSettings.isSyncEnabled && - !oldSettings.isSyncEnabled - ) { - void this.start(); } } ); @@ -111,13 +107,27 @@ export class SyncClient { const connectionStatus = new ConnectionStatus(settings, logger); const syncService = new SyncService(connectionStatus, settings, logger); syncService.fetchImplementation = fetch; + const fileOperations = new FileOperations( + logger, + database, + fs, + nativeLineEndings + ); + const unrestrictedSyncer = new UnrestrictedSyncer( + logger, + database, + settings, + syncService, + fileOperations, + history + ); const syncer = new Syncer( logger, database, settings, syncService, - new FileOperations(logger, database, fs, nativeLineEndings), - history + fileOperations, + unrestrictedSyncer ); const client = new SyncClient(