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;
|
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 = {
|
export const PLAYER_STATUS = {
|
||||||
PLAYING: 'PLAYING',
|
PLAYING: 'PLAYING',
|
||||||
|
|||||||
@@ -712,6 +712,14 @@ export default class Chat extends Component {
|
|||||||
<Card elevation={0} className="media-info-card">
|
<Card elevation={0} className="media-info-card">
|
||||||
{player.showName && player.status !== PLAYER_STATUS.NOT_PLAYING ? (
|
{player.showName && player.status !== PLAYER_STATUS.NOT_PLAYING ? (
|
||||||
<CardContent>
|
<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">
|
<Typography className="media-info-at" variant="overline">
|
||||||
{player.status === PLAYER_STATUS.PAUSED
|
{player.status === PLAYER_STATUS.PAUSED
|
||||||
? `PAUSED AT ${this.getPrettyTime(player.time)}`
|
? `PAUSED AT ${this.getPrettyTime(player.time)}`
|
||||||
|
|||||||
@@ -584,6 +584,9 @@ textarea::-webkit-scrollbar {
|
|||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
padding-left: 3px !important;
|
padding-left: 3px !important;
|
||||||
}
|
}
|
||||||
|
.media-info-at.updated-by {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
.media-info-container {
|
.media-info-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|||||||
@@ -23,18 +23,6 @@ module.exports = async (req, res) => {
|
|||||||
});
|
});
|
||||||
if (exists && roomPin !== bodydata.partyPin)
|
if (exists && roomPin !== bodydata.partyPin)
|
||||||
return res.status(401).send({ message: 'Incorrect party pin' });
|
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
|
// GET IF USER EXISTS AND IS ADMIN
|
||||||
const [userExists, userAdmin, userName] = await admin
|
const [userExists, userAdmin, userName] = await admin
|
||||||
.firestore()
|
.firestore()
|
||||||
@@ -101,7 +89,7 @@ module.exports = async (req, res) => {
|
|||||||
.collection('users')
|
.collection('users')
|
||||||
.doc(bodydata.uid)
|
.doc(bodydata.uid)
|
||||||
.set({
|
.set({
|
||||||
admin: false,
|
admin: adminUid === bodydata.uid,
|
||||||
name: bodydata.userName,
|
name: bodydata.userName,
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const admin = require('firebase-admin');
|
|||||||
|
|
||||||
module.exports = async (req, res) => {
|
module.exports = async (req, res) => {
|
||||||
console.log('Requested Leave - UID - ', req.params.uid, '\n\tRoom - ', req.params.rid);
|
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
|
const userName = await admin
|
||||||
.firestore()
|
.firestore()
|
||||||
.collection('rooms')
|
.collection('rooms')
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ module.exports = async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (roomData.status !== player.status) {
|
if (roomData.status !== player.status) {
|
||||||
|
player.updatedByName = userName;
|
||||||
await admin
|
await admin
|
||||||
.firestore()
|
.firestore()
|
||||||
.collection('rooms')
|
.collection('rooms')
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ body {
|
|||||||
|
|
||||||
.info {
|
.info {
|
||||||
width: 70rem;
|
width: 70rem;
|
||||||
max-width: 70rem !important;
|
max-width: 70rem;
|
||||||
display: inline-table;
|
display: inline-table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user