v1.3.2-beta/URGENT PATCH FIX, clean up fix

This commit is contained in:
Ayushya Amitabh
2020-06-03 22:12:23 -04:00
parent 178c5220d9
commit 7fb38e2b9e
12 changed files with 41 additions and 34 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "watch-party-crx", "name": "watch-party-crx",
"version": "1.3.0", "version": "1.3.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "watch-party-crx", "name": "watch-party-crx",
"version": "1.3.1", "version": "1.3.2",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@giphy/js-fetch-api": "^1.5.8", "@giphy/js-fetch-api": "^1.5.8",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "Watch Party", "name": "Watch Party",
"short_name": "WP", "short_name": "WP",
"version": "1.3.1", "version": "1.3.2",
"description": "Watch streamed content together.", "description": "Watch streamed content together.",
"background": { "background": {
"page": "popup.html" "page": "popup.html"
+8 -2
View File
@@ -8,6 +8,8 @@ import 'firebase/firestore';
import Inactive from './Inactive'; import Inactive from './Inactive';
import { getUserUid } from './Api'; import { getUserUid } from './Api';
const APP_VERSION = '1.3.2';
const darkTheme = createMuiTheme({ const darkTheme = createMuiTheme({
palette: { palette: {
type: 'dark', type: 'dark',
@@ -26,6 +28,10 @@ const Routes = (props) => (
</Router> </Router>
); );
const wrongVersionStatus = {
message: `Looks like Watch Party needs to update.\nGo to chrome://extensions to manually update.`,
};
const App = () => { const App = () => {
const closedNotification = { open: false, message: '' }; const closedNotification = { open: false, message: '' };
@@ -76,13 +82,13 @@ 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.active ? ( {status.active2 && status.version === APP_VERSION ? (
<Routes <Routes
updateLoading={setLoading} updateLoading={setLoading}
notify={(message) => setNotification({ open: true, message })} notify={(message) => setNotification({ open: true, message })}
/> />
) : ( ) : (
<Inactive status={status} /> <Inactive status={status.version !== APP_VERSION ? wrongVersionStatus : status} />
)} )}
</div> </div>
<Fab onClick={() => setVisible(!visible)} className="watch-party-fab"> <Fab onClick={() => setVisible(!visible)} className="watch-party-fab">
+1 -2
View File
@@ -111,8 +111,7 @@ export default class Chat extends Component {
return; return;
} }
this.setState(response); this.setState(response);
if (response.player && this.state.player !== response.player) if (response.player) this.mVideoListener.doUpdate(response.player);
this.mVideoListener.doUpdate(response.player);
const pcc = document.querySelector('.thread-container'); const pcc = document.querySelector('.thread-container');
if (pcc) pcc.scrollTop = pcc.scrollHeight; if (pcc) pcc.scrollTop = pcc.scrollHeight;
}); });
+10 -18
View File
@@ -90,20 +90,6 @@ body.amazon-prime textarea:focus {
box-shadow: none !important; box-shadow: none !important;
} }
@keyframes backgroundpulse {
0% {
background-color: black;
color: red;
}
50% {
background-color: red;
color: black;
}
100% {
background-color: black;
color: red;
}
}
#party-loading { #party-loading {
position: absolute; position: absolute;
width: 100%; width: 100%;
@@ -119,10 +105,16 @@ body.amazon-prime textarea:focus {
#party-loading.inactive { #party-loading.inactive {
flex-direction: column; flex-direction: column;
text-align: center; text-align: center;
animation-duration: 4s; padding: 2rem;
animation-timing-function: linear; width: calc(100% - 4rem);
animation-iteration-count: infinite; height: calc(100% - 4rem);
animation-name: backgroundpulse; white-space: break-spaces;
}
#party-loading.inactive .MuiTypography-overline {
font-size: 1.1rem !important;
}
#party-loading.inactive .MuiTypography-caption {
font-size: 1rem !important;
} }
#party-routes-wrapper { #party-routes-wrapper {
margin: 0; margin: 0;
+3
View File
@@ -25,6 +25,9 @@
}, },
"ui": { "ui": {
"enabled": true "enabled": true
},
"pubsub": {
"port": 8085
} }
}, },
"firestore": { "firestore": {
+2 -2
View File
@@ -1,4 +1,4 @@
const FunctionModules = require('./modules2/index'); const FunctionModules2 = require('./modules2/index');
const functions = require('firebase-functions'); const functions = require('firebase-functions');
const secret = require('./FirebaseSecret.json'); const secret = require('./FirebaseSecret.json');
const admin = require('firebase-admin'); const admin = require('firebase-admin');
@@ -18,4 +18,4 @@ exports.widgets2 = functions.https.onRequest(REST.v2);
exports.scheduledCleanUp = functions.pubsub exports.scheduledCleanUp = functions.pubsub
.schedule('every 60 minutes') .schedule('every 60 minutes')
.onRun(FunctionModules.scheduledCleanUp); .onRun(FunctionModules2.scheduledCleanUp);
+11 -4
View File
@@ -1,5 +1,12 @@
const admin = require('firebase-admin'); const admin = require('firebase-admin');
const FunctionModules = require('./index');
const timeDiff = (ds1, ds2) => {
const d1 = new Date(ds1);
const d2 = new Date(ds2);
var diff = (d2.getTime() - d1.getTime()) / 1000;
diff /= 60 * 60;
return Math.abs(Math.round(diff));
};
module.exports = async () => { module.exports = async () => {
const startedTime = new Date(); const startedTime = new Date();
@@ -19,10 +26,10 @@ module.exports = async () => {
.get() .get()
.then(async (roomSnap) => { .then(async (roomSnap) => {
if ( if (
FunctionModules.timeDiff(roomSnap.createTime.toDate(), startedTime) >= 24 || timeDiff(roomSnap.createTime.toDate(), startedTime) >= 24 ||
FunctionModules.timeDiff(roomSnap.updateTime.toDate(), startedTime) >= 12 timeDiff(roomSnap.updateTime.toDate(), startedTime) >= 12
) )
await FunctionModules.cleanUpRoom(roomSnap.id); await FunctionModules2.cleanUpRoom(roomSnap.id);
console.info(`Deleted room ${roomSnap.id} from auto cleanup`); console.info(`Deleted room ${roomSnap.id} from auto cleanup`);
return; return;
}) })
+1 -1
View File
@@ -1,4 +1,4 @@
module.exports = (ds1, ds2) => { module.exports = function (ds1, ds2) {
const d1 = new Date(ds1); const d1 = new Date(ds1);
const d2 = new Date(ds2); const d2 = new Date(ds2);
var diff = (d2.getTime() - d1.getTime()) / 1000; var diff = (d2.getTime() - d1.getTime()) / 1000;
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "watch-party-api", "name": "watch-party-api",
"version": "1.3.1", "version": "1.3.2",
"description": "Cloud Functions for Watch Party", "description": "Cloud Functions for Watch Party",
"scripts": { "scripts": {
"lint": "eslint .", "lint": "eslint .",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "watch-party", "name": "watch-party",
"version": "1.3.1", "version": "1.3.2",
"description": "Watch Party", "description": "Watch Party",
"scripts": { "scripts": {
"start": "firebase emulators:start", "start": "firebase emulators:start",