Fix live counter expiration
This commit is contained in:
parent
ed36a8a693
commit
0caad70a5e
1 changed files with 3 additions and 6 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue