Binds recursive call function to keep original scope

This commit is contained in:
Jordan Nguy 2021-09-25 17:50:10 -07:00
parent c23f04ba5a
commit 7e14084163
No known key found for this signature in database
GPG key ID: 413AFCC6BB204660

View file

@ -33,6 +33,6 @@ export default class ThirdParty {
const auth = await this.spotify.clientCredentialsGrant();
this.spotify.setAccessToken(auth.body.access_token);
this.spotifyTokenTimerId = setTimeout(this.refreshSpotifyToken, (auth.body.expires_in / 2) * 1000);
this.spotifyTokenTimerId = setTimeout(this.refreshSpotifyToken.bind(this), (auth.body.expires_in / 2) * 1000);
}
}