Skip to content

Commit

Permalink
Online status did not change when updated
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Apr 12, 2021
1 parent 9791ec3 commit 16b534b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/src/accounts/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import createLogger from '../logger';
import { serializer } from './serializer';
import { update } from '../server/socket/updater';
import { AccountOptions } from './options';
import { nextTick } from 'process';

export default class Account {
readonly client = new SteamUser();
Expand Down Expand Up @@ -78,12 +79,12 @@ export default class Account {
if (options.status.gameId !== -1) {
client.gamesPlayed(Number(options.status.gameId));
}
update(this);
this.update();
}

private onDisconnect(msg: string) {
this.logger.info(`We logged off: ${msg}`);
update(this);
this.update();
}

private onWebSession(cookies: string[]) {
Expand All @@ -107,6 +108,10 @@ export default class Account {
return auth;
}

update() {
nextTick(() => update(this));
}

get online() {
return !!this.client.steamID;
}
Expand Down

0 comments on commit 16b534b

Please sign in to comment.