Stop exposing Syncer from SyncClient

This commit is contained in:
Andras Schmelczer 2025-03-22 13:48:01 +00:00
parent 93b43f57b7
commit 2722f7c7fc
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
11 changed files with 84 additions and 55 deletions

View file

@ -9,7 +9,7 @@ export class ObsidianFileEventHandler {
if (file instanceof TFile) {
this.client.logger.info(`File created: ${file.path}`);
await this.client.syncer.syncLocallyCreatedFile(file.path);
await this.client.syncLocallyCreatedFile(file.path);
} else {
this.client.logger.debug(`Folder created: ${file.path}, ignored`);
}
@ -19,7 +19,7 @@ export class ObsidianFileEventHandler {
if (file instanceof TFile) {
this.client.logger.info(`File deleted: ${file.path}`);
await this.client.syncer.syncLocallyDeletedFile(file.path);
await this.client.syncLocallyDeletedFile(file.path);
} else {
this.client.logger.debug(`Folder deleted: ${file.path}, ignored`);
}
@ -29,7 +29,7 @@ export class ObsidianFileEventHandler {
if (file instanceof TFile) {
this.client.logger.info(`File renamed: ${oldPath} -> ${file.path}`);
await this.client.syncer.syncLocallyUpdatedFile({
await this.client.syncLocallyUpdatedFile({
oldPath,
relativePath: file.path
});
@ -48,7 +48,7 @@ export class ObsidianFileEventHandler {
this.client.logger.info(`File modified: ${file.path}`);
await this.client.syncer.syncLocallyUpdatedFile({
await this.client.syncLocallyUpdatedFile({
relativePath: file.path
});
} else {

View file

@ -33,7 +33,7 @@ export class SyncSettingsTab extends PluginSettingTab {
this.statusDescription = statusDescription;
this.editedVaultName = this.syncClient.getSettings().vaultName;
this.syncClient.addOnSettingsChangeHandlers(
this.syncClient.addOnSettingsChangeListener(
(newSettings, oldSettings) => {
if (newSettings.vaultName !== oldSettings.vaultName) {
this.editedVaultName = newSettings.vaultName;

View file

@ -17,14 +17,14 @@ export class StatusBar {
this.updateStatus();
});
this.syncClient.syncer.addRemainingOperationsListener(
this.syncClient.addRemainingSyncOperationsListener(
(remainingOperations) => {
this.lastRemaining = remainingOperations;
this.updateStatus();
}
);
this.syncClient.addOnSettingsChangeHandlers(() => {
this.syncClient.addOnSettingsChangeListener(() => {
this.updateStatus();
});
}

View file

@ -19,14 +19,14 @@ export class StatusDescription {
this.updateDescription();
});
this.syncClient.syncer.addRemainingOperationsListener(
this.syncClient.addRemainingSyncOperationsListener(
(remainingOperations) => {
this.lastRemaining = remainingOperations;
this.updateDescription();
}
);
this.syncClient.addOnSettingsChangeHandlers(() => {
this.syncClient.addOnSettingsChangeListener(() => {
void this.updateConnectionState();
});
}