From bd154bdd9ec03e21fd439e86081b065fa2f6dcbf Mon Sep 17 00:00:00 2001 From: Lewdcario Date: Thu, 25 Jan 2018 02:06:28 -0600 Subject: [PATCH] fix: nullable activity --- src/stores/ClientPresenceStore.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stores/ClientPresenceStore.js b/src/stores/ClientPresenceStore.js index 5d6914d12..eced8afa2 100644 --- a/src/stores/ClientPresenceStore.js +++ b/src/stores/ClientPresenceStore.js @@ -54,12 +54,16 @@ class ClientPresenceStore extends PresenceStore { application_id: applicationID || undefined, secrets: activity.secrets || undefined, instance: activity.instance || undefined, - } : this.clientPresence.activity, + } : null, }; + if ((status || afk || since) && !activity) { + packet.game = this.clientPresence.activity; + } + if (packet.game) { packet.game.type = typeof packet.game.type === 'number' ? - packet.game.type : ActivityTypes.indexOf(packet.game.type) + packet.game.type : ActivityTypes.indexOf(packet.game.type); } this.clientPresence.patch(packet);