mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2025-06-30 05:31:07 +02:00
Fix some undefined this in js classes
This commit is contained in:
@ -17,10 +17,10 @@ export class ViewerCounter {
|
||||
* @param {Number} updatePeriod
|
||||
*/
|
||||
regularUpdate(updatePeriod) {
|
||||
setInterval(this._refreshViewersCounter, updatePeriod);
|
||||
setInterval(() => this.refreshViewersCounter(), updatePeriod);
|
||||
}
|
||||
|
||||
_refreshViewersCounter() {
|
||||
refreshViewersCounter() {
|
||||
fetch(this.url)
|
||||
.then(response => response.json())
|
||||
.then((data) => this.element.innerText = data.ConnectedViewers)
|
||||
|
Reference in New Issue
Block a user