From 3e7494aef445bcb470b2c7c63bf8464555b19880 Mon Sep 17 00:00:00 2001 From: Ayushya Amitabh Date: Mon, 3 Aug 2020 11:54:28 -0400 Subject: [PATCH] v1.6.0/api2 update player hotfix --- functions/modules2/updatePlayer.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/functions/modules2/updatePlayer.js b/functions/modules2/updatePlayer.js index 9783f51..1a66ad7 100644 --- a/functions/modules2/updatePlayer.js +++ b/functions/modules2/updatePlayer.js @@ -32,18 +32,18 @@ module.exports = async (req, res) => { .then((userSnap) => userSnap.exists); if (userExists) { if (showChanged === true && player.showName) { - if (player.showChanged !== roomData.player.showName) { + if (player.showName !== roomData.player.showName) { await admin - .firestore() - .collection('rooms') - .doc(roomId) - .collection('messages') - .add({ - uid: '', - name: '', - text: `${userName} changed \n${player.showName ? 'to ' + player.showName : ''}`, - time: new Date(), - }); + .firestore() + .collection('rooms') + .doc(roomId) + .collection('messages') + .add({ + uid: '', + name: '', + text: `${userName} changed \n${player.showName ? 'to ' + player.showName : ''}`, + time: new Date(), + }); } } if (roomData.status !== player.status) {