Stop exposing Syncer from SyncClient
This commit is contained in:
parent
93b43f57b7
commit
2722f7c7fc
11 changed files with 84 additions and 55 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue