message: Triggering update network when joining layer
diff: @@ -244,6 +244,9 @@ export class Peer implements IPeer {
  this.currentLayer = layer;
  this.currentRooms.length = 0;
  this.updateKnownPeers(json);
  +
  + //@ts-ignore
  + const ignored = this.updateNetwork();
  }
  async joinRoom(roomId: string): Promise<any> {
  @@ -347,6 +350,7 @@ export class Peer implements IPeer {
  this.updatingNetwork = true;
  return new Promise(async (resolve, reject) => {
  + try {
  this.checkConnectionsSanity();
  let toConnectCount = this.config.minConnections! - this.connectedCount();
  @@ -375,10 +379,12 @@ export class Peer implements IPeer {
  .slice(0, toDisconnect)
  .forEach(peerId => this.disconnectFrom(peerId));
  }
  -
  - this.updatingNetwork = false;
  -
  resolve();
  + } catch (e) {
  + this.log(LogLevel.ERROR, "Error while updating network", e);
  + } finally {
  + this.updatingNetwork = false;
  + }
  });
  }
  