Rename method

This commit is contained in:
Andras Schmelczer 2025-11-30 14:43:22 +00:00
parent 5e5f8ecc22
commit 44d81a94fe

View file

@ -286,8 +286,8 @@ export class SyncClient {
* and the local database but retain the settings. * and the local database but retain the settings.
* The SyncClient can be used again after calling this method. * The SyncClient can be used again after calling this method.
*/ */
public async applyChangedConnectionSettings(): Promise<void> { public async reset(): Promise<void> {
this.checkIfDestroyed("applyChangedConnectionSettings"); this.checkIfDestroyed("reset");
this.logger.info( this.logger.info(
"Stopping SyncClient to apply changed connection settings" "Stopping SyncClient to apply changed connection settings"
@ -451,6 +451,7 @@ export class SyncClient {
this.fetchController.finishReset(); this.fetchController.finishReset();
await this.serverConfig.initialize(); await this.serverConfig.initialize();
this.webSocketManager.start();
if (!this.hasStartedOfflineSync) { if (!this.hasStartedOfflineSync) {
this.hasStartedOfflineSync = true; this.hasStartedOfflineSync = true;
@ -458,7 +459,6 @@ export class SyncClient {
} }
this.hasFinishedOfflineSync = true; this.hasFinishedOfflineSync = true;
this.webSocketManager.start();
} }
private async pause(): Promise<void> { private async pause(): Promise<void> {
@ -470,7 +470,7 @@ export class SyncClient {
private resetInMemoryState(): void { private resetInMemoryState(): void {
this.history.reset(); this.history.reset();
this.contentCache.reset(); this.contentCache.reset();
this.logger.reset(); // don't reset the logger
this.cursorTracker.reset(); this.cursorTracker.reset();
this.syncer.reset(); this.syncer.reset();
this.fileOperations.reset(); this.fileOperations.reset();
@ -486,7 +486,7 @@ export class SyncClient {
newSettings.vaultName !== oldSettings.vaultName || newSettings.vaultName !== oldSettings.vaultName ||
newSettings.remoteUri !== oldSettings.remoteUri newSettings.remoteUri !== oldSettings.remoteUri
) { ) {
await this.applyChangedConnectionSettings(); await this.reset();
} }
if (newSettings.isSyncEnabled !== oldSettings.isSyncEnabled) { if (newSettings.isSyncEnabled !== oldSettings.isSyncEnabled) {