Skip to content

Commit

Permalink
fix the lockfilewatch not being updated properly
Browse files Browse the repository at this point in the history
happened when starting a client, closing it and then starting a different one (like live -> pbe). Because the leaguePath already existed, this would stop checking prematurely
  • Loading branch information
Morilli authored and Hi-Ray committed Jan 29, 2021
1 parent 143c870 commit 64a1b68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/util/RiotConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export default class RiotConnector extends EventEmitter {
* Riot client isn't open, therefore we don't have the leaguePath.
*/
if (!this.leaguePath) return;
clearInterval(this._leagueClientWatch);

/**
* Return if we are already watching the lockfile (= path hasn't changed).
Expand Down Expand Up @@ -146,7 +145,7 @@ export default class RiotConnector extends EventEmitter {
this.emit("disconnect");
this._lockfileWatch.close();
console.log("Lost connection to leagueclient; restarting riotclient watch");
this.start();
this._riotClientWatch = setInterval(this._checkRiotClient.bind(this), 1000);
}

/**
Expand Down

0 comments on commit 64a1b68

Please sign in to comment.