From 5847ed2df07ef07b5e8a2a532d2d8475ea08df7b Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sun, 3 Mar 2024 13:58:28 -0500 Subject: [PATCH] fix minor bug with merged member load if guild is not found for a member, instead of continuing it would break and never set the app to ready --- src/stores/GatewayConnectionStore.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/stores/GatewayConnectionStore.ts b/src/stores/GatewayConnectionStore.ts index 858f206..f0cf05c 100644 --- a/src/stores/GatewayConnectionStore.ts +++ b/src/stores/GatewayConnectionStore.ts @@ -374,14 +374,11 @@ export default class GatewayConnectionStore { } }; - this.initialHeartbeatTimeout = setTimeout( - () => { - this.initialHeartbeatTimeout = null; - this.heartbeater = setInterval(heartbeaterFn, this.heartbeatInterval!); - heartbeaterFn(); - }, - Math.floor(Math.random() * this.heartbeatInterval!), - ); + this.initialHeartbeatTimeout = setTimeout(() => { + this.initialHeartbeatTimeout = null; + this.heartbeater = setInterval(heartbeaterFn, this.heartbeatInterval!); + heartbeaterFn(); + }, Math.floor(Math.random() * this.heartbeatInterval!)); }; /** @@ -494,7 +491,7 @@ export default class GatewayConnectionStore { const guild = this.app.guilds.get(m.guild_id); if (!guild) { this.logger.warn(`[Ready] Guild ${m.guild_id} not found for member ${m.id}`); - return; + continue; } guild.members.add(m); }