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) {