diff --git a/index.html b/index.html index 4ffca621..5f0c72f6 100644 --- a/index.html +++ b/index.html @@ -56,6 +56,9 @@
+ diff --git a/src/App.jsx b/src/App.jsx index faed1727..27936c49 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import React, { Component, lazy, Suspense } from 'react'; +import React, { Component, lazy } from 'react'; import { Provider } from 'react-redux'; import { Route, Switch, Redirect } from 'react-router'; import { ConnectedRouter } from 'connected-react-router'; @@ -14,6 +14,7 @@ import { fetchTurnCredentials } from './utils/turn'; import store, { history } from './store'; import ErrorFallback from './components/ErrorFallback'; +import BundleLoadBoundary from './components/BundleLoadBoundary'; import FullPageLoading from './components/FullPageLoading'; const Explorer = lazy(() => import('./components/explorer')); @@ -123,11 +124,7 @@ class App extends Component { } const showLogin = !MyCommaAuth.isAuthenticated() && !getZoom(window.location.pathname) && !getSegmentRange(window.location.pathname); - let content = ( - }> - { showLogin ? this.anonymousRoutes() : this.authRoutes() } - - ); + let content = showLogin ? this.anonymousRoutes() : this.authRoutes(); // Use ErrorBoundary in production only if (import.meta.env.PROD) { @@ -141,7 +138,11 @@ class App extends Component { return ( - {content} + ( + + {content} + + )} /> ); diff --git a/src/components/AppHeader/AccountMenu.jsx b/src/components/AppHeader/AccountMenu.jsx index af0d4174..48dba215 100644 --- a/src/components/AppHeader/AccountMenu.jsx +++ b/src/components/AppHeader/AccountMenu.jsx @@ -1,9 +1,11 @@ -import React, { useCallback, useMemo } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import dayjs from 'dayjs'; +import { Switch } from '@material-ui/core'; import MyCommaAuth from '@commaai/my-comma-auth'; import { USERADMIN_URL_ROOT } from '../../api'; +import { getDeveloperToolsEnabled, setDeveloperToolsEnabled } from '../../userSettings'; const logOut = async () => { await MyCommaAuth.logOut(); @@ -35,12 +37,19 @@ const Version = () => { const AccountMenu = ({ profile, open, onClose }) => { const version = useMemo(() => , []); + const [developerToolsEnabled, setDeveloperToolsState] = useState(getDeveloperToolsEnabled); const onLogOut = useCallback(() => { onClose(); logOut(); }, [onClose]); + const onDeveloperToolsChange = useCallback((event) => { + const enabled = event.target.checked; + setDeveloperToolsState(enabled); + setDeveloperToolsEnabled(enabled); + }, []); + if (!open) { return null; } @@ -64,6 +73,15 @@ const AccountMenu = ({ profile, open, onClose }) => { > Manage Account +