v1.4.3/members and version handling
This commit is contained in:
@@ -125,7 +125,8 @@ chrome.runtime.onConnect.addListener((port) => {
|
|||||||
const isAdmin = snap.docs
|
const isAdmin = snap.docs
|
||||||
.filter((user) => user.id === firebase.auth().currentUser.uid)[0]
|
.filter((user) => user.id === firebase.auth().currentUser.uid)[0]
|
||||||
.data().admin;
|
.data().admin;
|
||||||
port.postMessage({ admin: isAdmin });
|
const users = snap.docs.map((userSnap) => userSnap.data().name);
|
||||||
|
port.postMessage({ admin: isAdmin, users });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
|
|||||||
+10
-7
@@ -26,7 +26,8 @@ import 'firebase/firestore';
|
|||||||
import Inactive from './Inactive';
|
import Inactive from './Inactive';
|
||||||
import { getUserUid, getPlayerSource, PLAYER_SOURCE } from './Api';
|
import { getUserUid, getPlayerSource, PLAYER_SOURCE } from './Api';
|
||||||
|
|
||||||
const APP_VERSION = '1.4.0';
|
const APP_VERSION = '1.4.3';
|
||||||
|
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, '');
|
||||||
|
|
||||||
const darkTheme = createMuiTheme({
|
const darkTheme = createMuiTheme({
|
||||||
palette: {
|
palette: {
|
||||||
@@ -55,10 +56,6 @@ const Routes = (props) => (
|
|||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
|
|
||||||
const wrongVersionStatus = {
|
|
||||||
message: `Looks like Watch Party needs to update.\nGo to chrome://extensions to manually update.\nExpected version v${APP_VERSION}`,
|
|
||||||
};
|
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const closedNotification = { open: false, message: '' };
|
const closedNotification = { open: false, message: '' };
|
||||||
|
|
||||||
@@ -129,13 +126,19 @@ const App = () => {
|
|||||||
<div className="party-content-wrapper">
|
<div className="party-content-wrapper">
|
||||||
<div id="party-routes-wrapper">
|
<div id="party-routes-wrapper">
|
||||||
{loading && <Loading />}
|
{loading && <Loading />}
|
||||||
{status.active2 && status.version === APP_VERSION ? (
|
{status[APP_VERSION_STRING] && status[APP_VERSION_STRING].active === true ? (
|
||||||
<Routes
|
<Routes
|
||||||
updateLoading={setLoading}
|
updateLoading={setLoading}
|
||||||
notify={(message) => setNotification({ open: true, message })}
|
notify={(message) => setNotification({ open: true, message })}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Inactive status={status.version !== APP_VERSION ? wrongVersionStatus : status} />
|
<Inactive
|
||||||
|
status={
|
||||||
|
status[APP_VERSION_STRING]
|
||||||
|
? status[APP_VERSION_STRING].message
|
||||||
|
: 'Uh oh, looks like our servers are down right now.'
|
||||||
|
}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Fab onClick={() => setVisible(!visible)} className="watch-party-fab">
|
<Fab onClick={() => setVisible(!visible)} className="watch-party-fab">
|
||||||
|
|||||||
@@ -35,13 +35,15 @@ export default class CallManager {
|
|||||||
this.__admin = false;
|
this.__admin = false;
|
||||||
}
|
}
|
||||||
toggleCall(onCall, conference, admin) {
|
toggleCall(onCall, conference, admin) {
|
||||||
|
this.listener({ callActionPending: true });
|
||||||
this.__admin = admin;
|
this.__admin = admin;
|
||||||
if (onCall === true) this.leaveCall();
|
if (onCall === true) this.leaveCall();
|
||||||
else this.boot(conference);
|
else this.boot(conference);
|
||||||
}
|
}
|
||||||
toggleMute(muted) {
|
toggleMute(muted) {
|
||||||
|
this.listener({ callActionPending: true });
|
||||||
VoxeetSDK.conference.mute(VoxeetSDK.session.participant, !muted);
|
VoxeetSDK.conference.mute(VoxeetSDK.session.participant, !muted);
|
||||||
this.listener({ muted: !muted });
|
this.listener({ muted: !muted, callActionPending: false });
|
||||||
}
|
}
|
||||||
async boot(conference) {
|
async boot(conference) {
|
||||||
await this.initialize();
|
await this.initialize();
|
||||||
@@ -93,7 +95,7 @@ export default class CallManager {
|
|||||||
async leaveCall() {
|
async leaveCall() {
|
||||||
VoxeetSDK.conference.leave().then(() => {
|
VoxeetSDK.conference.leave().then(() => {
|
||||||
VoxeetSDK.session.close();
|
VoxeetSDK.session.close();
|
||||||
this.listener({ onCall: false });
|
this.listener({ onCall: false, callActionPending: false });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async openSession() {
|
async openSession() {
|
||||||
@@ -114,11 +116,11 @@ export default class CallManager {
|
|||||||
}
|
}
|
||||||
async initialize() {
|
async initialize() {
|
||||||
VoxeetSDK.conference.on('joined', () => {
|
VoxeetSDK.conference.on('joined', () => {
|
||||||
this.listener({ onCall: true });
|
this.listener({ onCall: true, callActionPending: false, voxeet: VoxeetSDK });
|
||||||
});
|
});
|
||||||
|
|
||||||
VoxeetSDK.conference.on('left', () => {
|
VoxeetSDK.conference.on('left', () => {
|
||||||
this.listener({ onCall: false });
|
this.listener({ onCall: false, callActionPending: false, voxeet: null });
|
||||||
});
|
});
|
||||||
|
|
||||||
VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
|
VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
|
||||||
@@ -135,7 +137,7 @@ export default class CallManager {
|
|||||||
});
|
});
|
||||||
|
|
||||||
VoxeetSDK.conference.on('streamRemoved', (participant, stream) => {
|
VoxeetSDK.conference.on('streamRemoved', (participant, stream) => {
|
||||||
document.getElementById(participant.id).remove();
|
if (document.getElementById(participant.id)) document.getElementById(participant.id).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
+28
-10
@@ -33,6 +33,7 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
Switch,
|
Switch,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
|
Chip,
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
import Thread from './Thread';
|
import Thread from './Thread';
|
||||||
import { Carousel } from '@giphy/react-components';
|
import { Carousel } from '@giphy/react-components';
|
||||||
@@ -49,10 +50,6 @@ import {
|
|||||||
emptyLocalData,
|
emptyLocalData,
|
||||||
updateLocalData,
|
updateLocalData,
|
||||||
} from './Api';
|
} from './Api';
|
||||||
import { goTo } from 'route-lite';
|
|
||||||
import Create from './Create';
|
|
||||||
import VideoListener from './VideoListener';
|
|
||||||
import CallManager from './CallManager';
|
|
||||||
import {
|
import {
|
||||||
Send,
|
Send,
|
||||||
ExitToApp as Exit,
|
ExitToApp as Exit,
|
||||||
@@ -63,13 +60,17 @@ import {
|
|||||||
MicOff,
|
MicOff,
|
||||||
Mic as MicOn,
|
Mic as MicOn,
|
||||||
Gif,
|
Gif,
|
||||||
MoreVert,
|
KeyboardArrowDown,
|
||||||
PauseCircleFilled,
|
PauseCircleFilled,
|
||||||
LinkOutlined,
|
LinkOutlined,
|
||||||
PlayCircleFilled,
|
PlayCircleFilled,
|
||||||
Cancel,
|
Cancel,
|
||||||
Error,
|
Error,
|
||||||
} from '@material-ui/icons';
|
} from '@material-ui/icons';
|
||||||
|
import Create from './Create';
|
||||||
|
import { goTo } from 'route-lite';
|
||||||
|
import CallManager from './CallManager';
|
||||||
|
import VideoListener from './VideoListener';
|
||||||
|
|
||||||
const giphyFetch = new GiphyFetch('ojJbIMUN6XRMn4mHiFFav3rMCpXUg8sq');
|
const giphyFetch = new GiphyFetch('ojJbIMUN6XRMn4mHiFFav3rMCpXUg8sq');
|
||||||
const alerts = [
|
const alerts = [
|
||||||
@@ -88,9 +89,11 @@ export default class Chat extends Component {
|
|||||||
messages: [],
|
messages: [],
|
||||||
newMessage: '',
|
newMessage: '',
|
||||||
admin: null,
|
admin: null,
|
||||||
|
users: [],
|
||||||
gif: false,
|
gif: false,
|
||||||
onCall: false,
|
onCall: false,
|
||||||
muted: false,
|
muted: false,
|
||||||
|
callActionPending: false,
|
||||||
menuPopover: true,
|
menuPopover: true,
|
||||||
allowChatNotification:
|
allowChatNotification:
|
||||||
LocalData().allowChatNotification !== undefined ? LocalData().allowChatNotification : true,
|
LocalData().allowChatNotification !== undefined ? LocalData().allowChatNotification : true,
|
||||||
@@ -164,6 +167,7 @@ export default class Chat extends Component {
|
|||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.mVideoListener.end();
|
this.mVideoListener.end();
|
||||||
|
this.leaveParty();
|
||||||
}
|
}
|
||||||
videoEventListener(video) {
|
videoEventListener(video) {
|
||||||
this.syncPlayer(video);
|
this.syncPlayer(video);
|
||||||
@@ -304,6 +308,8 @@ export default class Chat extends Component {
|
|||||||
muted,
|
muted,
|
||||||
player,
|
player,
|
||||||
allowChatNotification,
|
allowChatNotification,
|
||||||
|
users,
|
||||||
|
callActionPending,
|
||||||
} = this.state;
|
} = this.state;
|
||||||
return (
|
return (
|
||||||
<div className="party-chat-container">
|
<div className="party-chat-container">
|
||||||
@@ -316,7 +322,7 @@ export default class Chat extends Component {
|
|||||||
title="Share, leave, and other controls"
|
title="Share, leave, and other controls"
|
||||||
aria-label="Share, leave, and other controls"
|
aria-label="Share, leave, and other controls"
|
||||||
>
|
>
|
||||||
<MoreVert />
|
<KeyboardArrowDown />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -381,9 +387,17 @@ export default class Chat extends Component {
|
|||||||
color={allowChatNotification ? 'secondary' : 'primary'}
|
color={allowChatNotification ? 'secondary' : 'primary'}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
label="Allow chat notification when hidden"
|
label="Allow chat notification when side panel is closed"
|
||||||
labelPlacement="end"
|
labelPlacement="end"
|
||||||
/>
|
/>
|
||||||
|
<Typography className="party-controls-users-title" variant="overline">
|
||||||
|
PARTY MEMBERS
|
||||||
|
</Typography>
|
||||||
|
<div className="party-controls-users-container">
|
||||||
|
{users.map((user) => (
|
||||||
|
<Chip className="party-controls-users-chip" clickable size="small" label={user} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</ExpansionPanelDetails>
|
</ExpansionPanelDetails>
|
||||||
</ExpansionPanel>
|
</ExpansionPanel>
|
||||||
{player ? (
|
{player ? (
|
||||||
@@ -444,7 +458,11 @@ export default class Chat extends Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className="text-phone-panel">
|
<div className="text-phone-panel">
|
||||||
{gif || newMessage ? null : (
|
{gif || newMessage ? null : (
|
||||||
<IconButton onClick={this.handlePhoneCall} color={!onCall ? 'secondary' : 'primary'}>
|
<IconButton
|
||||||
|
disabled={callActionPending}
|
||||||
|
onClick={this.handlePhoneCall}
|
||||||
|
color={!onCall ? 'secondary' : 'primary'}
|
||||||
|
>
|
||||||
{onCall ? (
|
{onCall ? (
|
||||||
<Tooltip placement="top" title="Leave Call">
|
<Tooltip placement="top" title="Leave Call">
|
||||||
<PhoneDisable />
|
<PhoneDisable />
|
||||||
@@ -458,13 +476,13 @@ export default class Chat extends Component {
|
|||||||
)}
|
)}
|
||||||
{!gif && !newMessage && onCall && !muted ? (
|
{!gif && !newMessage && onCall && !muted ? (
|
||||||
<Tooltip title="Mute Mic" placement="top">
|
<Tooltip title="Mute Mic" placement="top">
|
||||||
<IconButton onClick={this.handleMute} color="primary">
|
<IconButton disabled={callActionPending} onClick={this.handleMute} color="primary">
|
||||||
<MicOff />
|
<MicOff />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
) : !gif && !newMessage && onCall && muted ? (
|
) : !gif && !newMessage && onCall && muted ? (
|
||||||
<Tooltip title="Unmute Mic" placement="top">
|
<Tooltip title="Unmute Mic" placement="top">
|
||||||
<IconButton onClick={this.handleMute} color="secondary">
|
<IconButton disabled={callActionPending} onClick={this.handleMute} color="secondary">
|
||||||
<MicOn />
|
<MicOn />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
+2
-11
@@ -85,10 +85,10 @@ export default class Create extends Component {
|
|||||||
if (userName && name && pin) {
|
if (userName && name && pin) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 'create':
|
case 'create':
|
||||||
this.createCall(userName, name.trim(), pin);
|
this.createCall(userName.trim(), name.trim(), pin);
|
||||||
break;
|
break;
|
||||||
case 'join':
|
case 'join':
|
||||||
this.joinCall(userName, name.trim(), pin);
|
this.joinCall(userName.trim(), name.trim(), pin);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.props.updateLoading(false);
|
this.props.updateLoading(false);
|
||||||
@@ -241,15 +241,6 @@ export default class Create extends Component {
|
|||||||
>
|
>
|
||||||
FAQ
|
FAQ
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
|
||||||
color="secondary"
|
|
||||||
target="_blank"
|
|
||||||
startIcon={<ContactSupportRounded />}
|
|
||||||
size="small"
|
|
||||||
href="mailto:admin@chromewatchparty.com?subject=User Feedback"
|
|
||||||
>
|
|
||||||
Feedback
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
color="secondary"
|
color="secondary"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
+2
-2
@@ -23,8 +23,8 @@ import { Warning } from '@material-ui/icons';
|
|||||||
const Inactive = (props) => (
|
const Inactive = (props) => (
|
||||||
<div id="party-loading" className="inactive">
|
<div id="party-loading" className="inactive">
|
||||||
<Warning />
|
<Warning />
|
||||||
<Typography variant="overline">PARTY IS PAUSED FOR A LITTLE CLEANUP</Typography>
|
<Typography variant="overline">SORRY, WATCH PARTY IS UNAVAILABLE RIGHT NOW</Typography>
|
||||||
<Typography variant="caption">{props.status.message}</Typography>
|
<Typography variant="caption">{props.status}</Typography>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+13
-3
@@ -124,19 +124,23 @@ body.amazon-prime textarea:focus {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
}
|
}
|
||||||
|
#party-loading.inactive .MuiSvgIcon-root {
|
||||||
|
font-size: 50px !important;
|
||||||
|
}
|
||||||
#party-loading.inactive {
|
#party-loading.inactive {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
width: calc(100% - 4rem);
|
width: calc(100% - 4rem);
|
||||||
|
background: #424242;
|
||||||
height: calc(100% - 4rem);
|
height: calc(100% - 4rem);
|
||||||
white-space: break-spaces;
|
white-space: break-spaces;
|
||||||
}
|
}
|
||||||
#party-loading.inactive .MuiTypography-overline {
|
#party-loading.inactive .MuiTypography-overline {
|
||||||
font-size: 1.1rem !important;
|
font-size: 13px !important;
|
||||||
}
|
}
|
||||||
#party-loading.inactive .MuiTypography-caption {
|
#party-loading.inactive .MuiTypography-caption {
|
||||||
font-size: 1rem !important;
|
font-size: 11px !important;
|
||||||
}
|
}
|
||||||
#party-routes-wrapper {
|
#party-routes-wrapper {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -342,7 +346,12 @@ textarea::-webkit-scrollbar {
|
|||||||
.party-controls button:hover .MuiButton-startIcon {
|
.party-controls button:hover .MuiButton-startIcon {
|
||||||
margin-right: 8px !important;
|
margin-right: 8px !important;
|
||||||
}
|
}
|
||||||
|
.party-controls-users-chip {
|
||||||
|
font-size: 11px !important;
|
||||||
|
letter-spacing: 1.1px !important;
|
||||||
|
margin-bottom: 3.5px !important;
|
||||||
|
margin-right: 7px !important;
|
||||||
|
}
|
||||||
.media-info-card {
|
.media-info-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-top-left-radius: 0 !important;
|
border-top-left-radius: 0 !important;
|
||||||
@@ -354,6 +363,7 @@ textarea::-webkit-scrollbar {
|
|||||||
.media-info-card .MuiCardContent-root {
|
.media-info-card .MuiCardContent-root {
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
.party-controls-users-title,
|
||||||
.media-info-at {
|
.media-info-at {
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
padding-left: 3px !important;
|
padding-left: 3px !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user