Skip to content

Commit

Permalink
Do not emit DatawalletSynchronizedEvent with disabled Datawallet (#389)
Browse files Browse the repository at this point in the history
* fix: only pulish DatawalletSynchronizedEvent

* chore: undefined
  • Loading branch information
jkoenig134 authored Jan 14, 2025
1 parent e5d3324 commit 986b153
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DataEvent } from "../DataEvent";

export class DatawalletSynchronizedEvent extends DataEvent<any> {
export class DatawalletSynchronizedEvent extends DataEvent<undefined> {
public static readonly namespace: string = "transport.datawalletSynchronized";

public constructor(eventTargetAddress: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TransportDataEvent } from "./TransportDataEvent";

export class DatawalletSynchronizedEvent extends TransportDataEvent<any> {
export class DatawalletSynchronizedEvent extends TransportDataEvent<undefined> {
public static readonly namespace: string = "transport.datawalletSynchronized";

public constructor(eventTargetAddress: string) {
Expand Down
4 changes: 3 additions & 1 deletion packages/transport/src/modules/sync/SyncController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export class SyncController extends TransportController {
await this.syncDatawallet(changedItems).catch((e) => this.log.error(e));
}

this.transport.eventBus.publish(new DatawalletSynchronizedEvent(this.parent.identity.address.toString()));
if (this.datawalletEnabled) {
this.transport.eventBus.publish(new DatawalletSynchronizedEvent(this.parent.identity.address.toString()));
}
}

return changedItems;
Expand Down

0 comments on commit 986b153

Please sign in to comment.