Skip to content

Commit

Permalink
Merge pull request #125 from giranm/fix/blank-screen-render
Browse files Browse the repository at this point in the history
[Fix] Blank page on render due to missing token from sessionStorage
  • Loading branch information
giranm authored May 25, 2022
2 parents 6c2f5e8 + 52c3243 commit 68991d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pd-live-react",
"homepage": "https://giranm.github.io/pd-live-react",
"version": "0.0.16-alpha.0",
"version": "0.0.17-alpha.0",
"private": true,
"dependencies": {
"@craco/craco": "7.0.0-alpha.3",
Expand Down
7 changes: 7 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ import {
store,
} from 'redux/store';

import PDOAuth from 'util/pdoauth';

import {
PD_REQUIRED_ABILITY,
PD_OAUTH_CLIENT_ID,
PD_OAUTH_CLIENT_SECRET,
LOG_ENTRIES_POLLING_INTERVAL_SECONDS,
LOG_ENTRIES_CLEARING_INTERVAL_SECONDS,
} from 'config/constants';
Expand Down Expand Up @@ -94,6 +98,9 @@ const App = ({
// Verify if session token is present
const token = sessionStorage.getItem('pd_access_token');
if (!token) {
useEffect(() => {
PDOAuth.login(PD_OAUTH_CLIENT_ID, PD_OAUTH_CLIENT_SECRET);
}, []);
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/config/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// generated by genversion
module.exports = '0.0.16-alpha.0';
module.exports = '0.0.17-alpha.0';

0 comments on commit 68991d6

Please sign in to comment.