v1.4.3/members and version handling

This commit is contained in:
2020-07-19 03:27:05 -04:00
parent 21ac7e2f3f
commit c80121bf25
7 changed files with 64 additions and 39 deletions
+10 -7
View File
@@ -26,7 +26,8 @@ import 'firebase/firestore';
import Inactive from './Inactive';
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({
palette: {
@@ -55,10 +56,6 @@ const Routes = (props) => (
</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 closedNotification = { open: false, message: '' };
@@ -129,13 +126,19 @@ const App = () => {
<div className="party-content-wrapper">
<div id="party-routes-wrapper">
{loading && <Loading />}
{status.active2 && status.version === APP_VERSION ? (
{status[APP_VERSION_STRING] && status[APP_VERSION_STRING].active === true ? (
<Routes
updateLoading={setLoading}
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>
<Fab onClick={() => setVisible(!visible)} className="watch-party-fab">