Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another attempt at fixing white screen error #1563

Merged
merged 1 commit into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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