Pick up new events API

This commit is contained in:
Andras Schmelczer 2025-12-07 14:46:41 +00:00
parent 0a5bbbf20e
commit 504ddb6ff6
7 changed files with 17 additions and 17 deletions

View file

@ -24,7 +24,7 @@ export class HistoryView extends ItemView {
super(leaf);
this.icon = HistoryView.ICON;
this.client.addSyncHistoryUpdateListener(async () =>
this.client.onSyncHistoryUpdated.add(async () =>
this.updateView().catch((error: unknown) => {
this.client.logger.error(
`Failed to update history view: ${error}`

View file

@ -21,7 +21,7 @@ export class LogsView extends ItemView {
) {
super(leaf);
this.icon = LogsView.ICON;
this.client.logger.addOnMessageListener(() => {
this.client.logger.onLogEmitted.add(() => {
this.updateView();
});
}

View file

@ -41,7 +41,7 @@ export class SyncSettingsTab extends PluginSettingTab {
this.editedToken = this.syncClient.getSettings().token;
this.editedVaultName = this.syncClient.getSettings().vaultName;
this.syncClient.addOnSettingsChangeListener(
this.syncClient.onSettingsChanged.add(
(newSettings, oldSettings) => {
let hasChanged = false;

View file

@ -14,19 +14,19 @@ export class StatusBar {
private readonly syncClient: SyncClient
) {
this.statusBarItem = plugin.addStatusBarItem();
this.syncClient.addSyncHistoryUpdateListener((status) => {
this.syncClient.onSyncHistoryUpdated.add((status) => {
this.lastHistoryStats = status;
this.updateStatus();
});
this.syncClient.addRemainingSyncOperationsListener(
this.syncClient.onRemainingOperationsCountChanged.add(
(remainingOperations) => {
this.lastRemaining = remainingOperations;
this.updateStatus();
}
);
this.syncClient.addOnSettingsChangeListener(() => {
this.syncClient.onSettingsChanged.add(() => {
this.updateStatus();
});
}

View file

@ -17,23 +17,23 @@ export class StatusDescription {
public constructor(private readonly syncClient: SyncClient) {
void this.updateConnectionState();
syncClient.addSyncHistoryUpdateListener((status) => {
syncClient.onSyncHistoryUpdated.add((status) => {
this.lastHistoryStats = status;
this.updateDescription();
});
this.syncClient.addRemainingSyncOperationsListener(
this.syncClient.onRemainingOperationsCountChanged.add(
(remainingOperations) => {
this.lastRemaining = remainingOperations;
this.updateDescription();
}
);
this.syncClient.addWebSocketStatusChangeListener(async () =>
this.syncClient.onWebSocketStatusChanged.add(async () =>
this.updateConnectionState()
);
this.syncClient.addOnSettingsChangeListener(async () =>
this.syncClient.onSettingsChanged.add(async () =>
this.updateConnectionState()
);
}