Fix live counter expiration

This commit is contained in:
Mikko Ahlroth 2020-04-04 18:44:09 +03:00
parent ed36a8a693
commit 0caad70a5e

View file

@ -18,12 +18,7 @@ export class LiveCounter extends Component {
}
public add(view: IPageView) {
let amount = 0;
if (this.sessions.has(view.session)) {
amount = this.sessions.get(view.session)!;
}
const amount: number = this.sessions.get(view.session) || 0;
this.sessions.set(view.session, amount + 1);
this.render();
}
@ -37,6 +32,8 @@ export class LiveCounter extends Component {
this.sessions.set(view.session, amount - 1);
}
}
this.render();
}
public render() {