Skip to content

Commit 29b7585

Browse files
committed
Renamed CDialog to RefreshDlg, reset timer to .5s
1 parent a39fe67 commit 29b7585

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/client/src/App.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Admin from './pages/Admin';
88
import DataView from './pages/DataView360/DataView360';
99
import About from './pages/About';
1010
import Login from './components/Login/Login';
11-
import CDialog from './components/CDialog';
11+
import RefreshDlg from './components/RefreshDlg';
1212
import Check from './pages/Check/Check';
1313
import Refresh from './components/Refresh';
1414

@@ -17,7 +17,7 @@ var jwt = require('jsonwebtoken');
1717

1818
// Triggers token expiration check
1919
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
20-
const expTimer = () => sleep(5000).then(() => ({}))
20+
const expTimer = () => sleep(500).then(() => ({}))
2121

2222
const AuthContext = React.createContext()
2323

@@ -87,9 +87,9 @@ function AuthenticatedApp() {
8787

8888
{ !jwtExpired && hdr ? hdr : '' /* Above-chosen header, or if logged out, no header */ }
8989

90-
{popRefreshAlert && <CDialog shouldOpen={true} setToken={setToken} /> } {/* Pop up the refresh dialog */}
90+
{popRefreshAlert && <RefreshDlg shouldOpen={true} setToken={setToken} /> } {/* Pop up the refresh dialog */}
9191

92-
{jwtExpired && <CDialog shouldOpen={false} setToken={setToken} /> } { /* Too late, expired: close the dialog */}
92+
{jwtExpired && <RefreshDlg shouldOpen={false} setToken={setToken} /> } { /* Too late, expired: close the dialog */}
9393

9494

9595
{ /* If not logged in, show login screen */

src/client/src/components/CDialog.js renamed to src/client/src/components/RefreshDlg.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import DialogContent from '@material-ui/core/DialogContent';
66
import DialogContentText from '@material-ui/core/DialogContentText';
77
import DialogTitle from '@material-ui/core/DialogTitle';
88

9-
import useToken from '../components/Login/useToken';
9+
import useToken from './Login/useToken';
1010

1111
import Refresh from './Refresh';
1212

13-
export default function CDialog(props) {
13+
export default function RefreshDlg(props) {
1414
const [open, setOpen] = React.useState(props.shouldOpen);
1515
const { access_token } = useToken(); // We want to use the passed-in top-level setToken
1616

0 commit comments

Comments
 (0)