mirror of https://github.com/waku-org/js-waku.git
Simplify code
This commit is contained in:
parent
34e6ac5247
commit
acdc032253
|
@ -76,7 +76,7 @@ export class Waku {
|
||||||
this.lightPush = lightPush;
|
this.lightPush = lightPush;
|
||||||
this.keepAliveTimers = {};
|
this.keepAliveTimers = {};
|
||||||
|
|
||||||
const keepAlive = options.keepAlive !== undefined ? options.keepAlive : 0;
|
const keepAlive = options.keepAlive || 0;
|
||||||
|
|
||||||
if (keepAlive !== 0) {
|
if (keepAlive !== 0) {
|
||||||
libp2p.connectionManager.on('peer:connect', (connection: Connection) => {
|
libp2p.connectionManager.on('peer:connect', (connection: Connection) => {
|
||||||
|
|
|
@ -87,11 +87,7 @@ export class WakuRelay extends Gossipsub {
|
||||||
|
|
||||||
Object.assign(this, { multicodecs });
|
Object.assign(this, { multicodecs });
|
||||||
|
|
||||||
if (options?.pubsubTopic) {
|
this.pubsubTopic = options?.pubsubTopic || constants.DefaultPubsubTopic;
|
||||||
this.pubsubTopic = options.pubsubTopic;
|
|
||||||
} else {
|
|
||||||
this.pubsubTopic = constants.DefaultPubsubTopic;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue