Skip to content

Commit

Permalink
Fix #1399 (Trying to unset games with values other than null doesn'…
Browse files Browse the repository at this point in the history
…t end up displaying properly for mobile clients)
  • Loading branch information
amishshah committed Apr 21, 2017
1 parent 94e2a85 commit 5605dc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/structures/ClientUser.js
Expand Up @@ -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);

Expand Down Expand Up @@ -231,7 +231,7 @@ class ClientUser extends User {
* @returns {Promise<ClientUser>}
*/
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,
Expand Down

0 comments on commit 5605dc0

Please sign in to comment.