From 5605dc04e165538386edc4bd11b071aca3c114fb Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Fri, 21 Apr 2017 11:42:19 +0100 Subject: [PATCH] Fix #1399 (Trying to unset games with values other than `null` doesn't end up displaying properly for mobile clients) --- src/structures/ClientUser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index bd54f2390ca1..54925a5fbed5 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -184,10 +184,10 @@ class ClientUser extends User { if (data.game) { game = data.game; if (game.url) game.type = 1; + } else if (typeof data.game !== 'undefined') { + game = null; } - if (data.game === null) game = null; - if (typeof data.afk !== 'undefined') afk = data.afk; afk = Boolean(afk); @@ -231,7 +231,7 @@ class ClientUser extends User { * @returns {Promise} */ setGame(game, streamingURL) { - if (game === null) return this.setPresence({ game }); + if (!game) return this.setPresence({ game: null }); return this.setPresence({ game: { name: game, url: streamingURL,