v1.7.2/release

This commit is contained in:
2020-09-09 14:56:39 -04:00
parent eaf7663f0c
commit 7d016f1423
14 changed files with 951 additions and 346 deletions
+15 -11
View File
@@ -9,13 +9,14 @@ ALL CONTENT ON WATCH PARTY'S WEBSITE OR IN WATCH PARTY'S CHROME EXTENSION APP, U
CITED ARE THE SOLE INTELLECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
************************************************************************/
/*global chrome*/
/*global browser*/
import React, { useState, useEffect } from 'react';
import Router from 'route-lite';
import { Fab, createMuiTheme, ThemeProvider, Snackbar, Tooltip } from '@material-ui/core';
import Create from './Create';
import Loading from './Loading';
import firebase from 'firebase/app';
import 'firebase/firestore';
import Inactive from './Inactive';
import {
getUserUid,
@@ -73,6 +74,9 @@ const startResize = (ev) => {
document.documentElement.addEventListener('mouseup', stopResize, false);
};
let CHROME_OR_BROWSER = chrome || browser;
let port;
const App = () => {
const closedNotification = { open: false, message: '' };
@@ -87,14 +91,14 @@ const App = () => {
useEffect(() => {
setLoading(true);
getUserUid();
firebase
.firestore()
.collection('server')
.doc('status')
.onSnapshot((statusSnap) => {
setStatus(statusSnap.data());
setLoading(false);
});
port = CHROME_OR_BROWSER.runtime.connect({ name: `WATCH_PARTY_STATUS` });
port.postMessage({
type: 'STATUS',
});
port.onMessage.addListener((response) => {
setStatus(response.status);
setLoading(false);
});
getShowWPButton().then((showWPButton) => {
setShowFab(showWPButton);
if (showWPButton === true) {
@@ -185,7 +189,7 @@ const App = () => {
status={
status[APP_VERSION_STRING]
? status[APP_VERSION_STRING].message
: "Uh oh, can't connect to server. Trying again..."
: 'Connecting to server...'
}
/>
)}