From 1dd16c70344e401a0dc5e0b38d3a748a06d92ec9 Mon Sep 17 00:00:00 2001 From: Ayushya Amitabh Date: Wed, 29 Jul 2020 18:36:15 -0400 Subject: [PATCH] v1.6.0/updateplayer name fix --- app/src/Chat.js | 2 +- functions/modules2/updatePlayer.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/Chat.js b/app/src/Chat.js index db09b9f..583d74f 100644 --- a/app/src/Chat.js +++ b/app/src/Chat.js @@ -208,7 +208,7 @@ export default class Chat extends Component { const { status, showName, time, source, element, showChanged } = video; if (element) { UpdatePlayerApi({ - roomId: LocalData().partyName, + roomId: LocalData().partyName || this.state.name, showChanged, userName: LocalData().userName, player: { diff --git a/functions/modules2/updatePlayer.js b/functions/modules2/updatePlayer.js index 121e14f..ccf9c27 100644 --- a/functions/modules2/updatePlayer.js +++ b/functions/modules2/updatePlayer.js @@ -14,6 +14,7 @@ module.exports = async (req, res) => { // player.time > 3600 // ? new Date(player.time * 1000).toISOString().substr(11, 8) // : new Date(player.time * 1000).toISOString().substr(14, 5); + if (!roomId) return res.status(400).send({ message: 'Party name not sent.' }); const [roomExists, roomData] = await admin .firestore() .collection('rooms')