mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
refactor: compare with undefined directly (#9191)
* refactor: compare with `undefined` directly * fix: lint
This commit is contained in:
@@ -498,7 +498,7 @@ export class Networking extends EventEmitter {
|
||||
public dispatchAudio() {
|
||||
const state = this.state;
|
||||
if (state.code !== NetworkingStatusCode.Ready) return false;
|
||||
if (typeof state.preparedPacket !== 'undefined') {
|
||||
if (state.preparedPacket !== undefined) {
|
||||
this.playAudioPacket(state.preparedPacket);
|
||||
state.preparedPacket = undefined;
|
||||
return true;
|
||||
|
||||
@@ -161,7 +161,7 @@ export class VoiceWebSocket extends EventEmitter {
|
||||
* @param ms - The interval in milliseconds. If negative, the interval will be unset
|
||||
*/
|
||||
public setHeartbeatInterval(ms: number) {
|
||||
if (typeof this.heartbeatInterval !== 'undefined') clearInterval(this.heartbeatInterval);
|
||||
if (this.heartbeatInterval !== undefined) clearInterval(this.heartbeatInterval);
|
||||
if (ms > 0) {
|
||||
this.heartbeatInterval = setInterval(() => {
|
||||
if (this.lastHeartbeatSend !== 0 && this.missedHeartbeats >= 3) {
|
||||
|
||||
Reference in New Issue
Block a user