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
+1
View File
@@ -12,6 +12,7 @@ COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html {
height: fit-content;
+26 -7
View File
@@ -10,8 +10,11 @@ CITED ARE THE SOLE INTELLECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
************************************************************************/
/* global chrome */
/* global browswer */
/* global firebase */
let CHROME_OR_BROWSER = chrome || browser;
const APP_VERSION = '1.7.2';
const APP_VERSION_STRING = APP_VERSION.replace(/\./g, '');
@@ -71,19 +74,19 @@ const sendAuth = async (sendResponse) => {
sendResponse(firebase.auth().currentUser);
};
chrome.runtime.onInstalled.addListener((details) => {
CHROME_OR_BROWSER.runtime.onInstalled.addListener((details) => {
if (details.reason) {
if (details.reason === 'install') {
if (window.localStorage.getItem('watchPartyVersion')) {
if (window.localStorage.getItem('watchPartyVersion') !== APP_VERSION) {
chrome.tabs.create({
CHROME_OR_BROWSER.tabs.create({
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
active: true,
});
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
}
} else {
chrome.tabs.create({
CHROME_OR_BROWSER.tabs.create({
url: 'https://www.chromewatchparty.com/welcome',
active: true,
});
@@ -92,14 +95,14 @@ chrome.runtime.onInstalled.addListener((details) => {
} else if (details.reason === 'update') {
if (window.localStorage.getItem('watchPartyVersion')) {
if (window.localStorage.getItem('watchPartyVersion') !== APP_VERSION) {
chrome.tabs.create({
CHROME_OR_BROWSER.tabs.create({
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
active: true,
});
window.localStorage.setItem('watchPartyVersion', APP_VERSION);
}
} else {
chrome.tabs.create({
CHROME_OR_BROWSER.tabs.create({
url: `http://www.chromewatchparty.com/changes/v${APP_VERSION}`,
active: true,
});
@@ -109,7 +112,7 @@ chrome.runtime.onInstalled.addListener((details) => {
}
});
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
CHROME_OR_BROWSER.runtime.onMessage.addListener((request, sender, sendResponse) => {
const { type } = request;
switch (type) {
case 'API_CALL':
@@ -152,10 +155,11 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
return true;
});
chrome.runtime.onConnect.addListener((port) => {
CHROME_OR_BROWSER.runtime.onConnect.addListener((port) => {
port.onDisconnect.addListener(() => {
port.roomListener && port.roomListener();
port.userListener && port.userListener();
port.statusListener && port.statusListener();
port.messageListener && port.messageListener();
});
port.onMessage.addListener((request) => {
@@ -233,6 +237,21 @@ chrome.runtime.onConnect.addListener((port) => {
])
);
}
} else if (type === 'STATUS') {
port.statusListener = firebase
.firestore()
.collection('server')
.doc('status')
.onSnapshot(
(statusSnap) => {
port.postMessage({
status: statusSnap.data(),
});
},
(err) => {
port.postMessage({ isError: true, ...err });
}
);
}
});
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -4
View File
@@ -12,10 +12,7 @@ COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv="Content-Security-Policy"
content="default-src *; style-src 'self' https://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval'"
/>
<meta charset="utf-8" />
<style>
:root {
--mdc-theme-primary: #beff94 !important;