Pick up new events API
This commit is contained in:
parent
0a5bbbf20e
commit
504ddb6ff6
7 changed files with 17 additions and 17 deletions
|
|
@ -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}`
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue