Fix #1399 (Trying to unset games with values other than null doesn't end up displaying properly for mobile clients)

This commit is contained in:
Amish Shah
2017-04-21 11:42:19 +01:00
parent 94e2a85386
commit 5605dc04e1

View File

@@ -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<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,