Skip to content

Commit

Permalink
Merge pull request #1563 from Automattic/fix/whitescreen-issue
Browse files Browse the repository at this point in the history
Another attempt at fixing white screen error
  • Loading branch information
belcherj authored Sep 3, 2019
2 parents add6b86 + ff7975e commit 0549faa
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ const appProvider = 'simplenote.com';
const appID = config.app_id;
let token = cookie.token || localStorage.access_token;

// Signs out the user from app engine and redirects to signin page
const redirectToWebSigninIfNecessary = () => {
if (!config.is_app_engine) {
return;
}

if (window.webConfig && window.webConfig.signout) {
window.webConfig.signout(function() {
window.location = `${config.app_engine_url}/`;
});
}
};

// Redirect to web sign in if running on App Engine
if (!token && config.is_app_engine) {
redirectToWebSigninIfNecessary();
Expand Down Expand Up @@ -213,19 +226,6 @@ const resetStorageIfAccountChanged = newAccountName => {
}
};

// Signs out the user from app engine and redirects to signin page
const redirectToWebSigninIfNecessary = () => {
if (!config.is_app_engine) {
return;
}

if (window.webConfig && window.webConfig.signout) {
window.webConfig.signout(function() {
window.location = `${config.app_engine_url}/`;
});
}
};

// Set account email if app engine provided it
if (cookie.email && config.is_app_engine) {
// If the stored email doesn't match, we should reset the app storage
Expand Down

0 comments on commit 0549faa

Please sign in to comment.