v1.7.6/show player updated by
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
|
||||
|
||||
let CHROME_OR_BROWSER = chrome || browser;
|
||||
|
||||
const API_HOST = 'https://api.chromewatchparty.com';
|
||||
const API_HOST = 'http://localhost:5001/watch-party-crx/us-central1/widgets';
|
||||
|
||||
export const PLAYER_STATUS = {
|
||||
PLAYING: 'PLAYING',
|
||||
|
||||
@@ -712,6 +712,14 @@ export default class Chat extends Component {
|
||||
<Card elevation={0} className="media-info-card">
|
||||
{player.showName && player.status !== PLAYER_STATUS.NOT_PLAYING ? (
|
||||
<CardContent>
|
||||
<Typography
|
||||
style={{ display: 'block' }}
|
||||
className="media-info-at updated-by"
|
||||
variant="caption"
|
||||
color="secondary"
|
||||
>
|
||||
Last updated by {player.updatedByName}
|
||||
</Typography>
|
||||
<Typography className="media-info-at" variant="overline">
|
||||
{player.status === PLAYER_STATUS.PAUSED
|
||||
? `PAUSED AT ${this.getPrettyTime(player.time)}`
|
||||
|
||||
@@ -584,6 +584,9 @@ textarea::-webkit-scrollbar {
|
||||
font-size: 10px !important;
|
||||
padding-left: 3px !important;
|
||||
}
|
||||
.media-info-at.updated-by {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
.media-info-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
@@ -23,18 +23,6 @@ module.exports = async (req, res) => {
|
||||
});
|
||||
if (exists && roomPin !== bodydata.partyPin)
|
||||
return res.status(401).send({ message: 'Incorrect party pin' });
|
||||
if (adminUid === bodydata.uid) {
|
||||
await admin
|
||||
.firestore()
|
||||
.collection('rooms')
|
||||
.doc(bodydata.partyName)
|
||||
.collection('users')
|
||||
.doc(bodydata.uid)
|
||||
.set({
|
||||
admin: true,
|
||||
name: bodydata.userName,
|
||||
});
|
||||
}
|
||||
// GET IF USER EXISTS AND IS ADMIN
|
||||
const [userExists, userAdmin, userName] = await admin
|
||||
.firestore()
|
||||
@@ -101,7 +89,7 @@ module.exports = async (req, res) => {
|
||||
.collection('users')
|
||||
.doc(bodydata.uid)
|
||||
.set({
|
||||
admin: false,
|
||||
admin: adminUid === bodydata.uid,
|
||||
name: bodydata.userName,
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
@@ -2,6 +2,8 @@ const admin = require('firebase-admin');
|
||||
|
||||
module.exports = async (req, res) => {
|
||||
console.log('Requested Leave - UID - ', req.params.uid, '\n\tRoom - ', req.params.rid);
|
||||
if (req.params.uid === 'undefined') return res.status(400).send({ message: 'No UID' });
|
||||
if (req.params.rid === 'undefined') return res.status(400).send({ message: 'No Party Name' });
|
||||
const userName = await admin
|
||||
.firestore()
|
||||
.collection('rooms')
|
||||
|
||||
@@ -26,6 +26,7 @@ module.exports = async (req, res) => {
|
||||
}
|
||||
}
|
||||
if (roomData.status !== player.status) {
|
||||
player.updatedByName = userName;
|
||||
await admin
|
||||
.firestore()
|
||||
.collection('rooms')
|
||||
|
||||
@@ -63,7 +63,7 @@ body {
|
||||
|
||||
.info {
|
||||
width: 70rem;
|
||||
max-width: 70rem !important;
|
||||
max-width: 70rem;
|
||||
display: inline-table;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user