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

Remove usage of local storage for config in angular app. #628

Merged
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
23 changes: 1 addition & 22 deletions legacy/src/app/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ const bootstrapOverWebsocket = () => {
break;
}
if (messagesReceived.length === 4) {
// Only store the config once the MAAS has been set up. The intro pages
// refresh the window when each one completes, so we don't want the
// stored config to get out of sync (there is also little optimisation to
// be gained as the user won't be switching between the AngularJS and
// React clients during the intro flow).
if (config.completed_intro && config.current_user.completed_intro) {
window.localStorage.setItem("maas-config", JSON.stringify(config));
}
bootstrapApp(config);
webSocket.close();
}
Expand All @@ -122,17 +114,4 @@ const bootstrapOverWebsocket = () => {
};
};

/**
* Load configuration from localstorage or websocket,
* then manually bootstrap angularjs app.
*/
const bootstrap = () => {
const savedConfig = window.localStorage.getItem("maas-config");
if (savedConfig) {
bootstrapApp(JSON.parse(savedConfig));
} else {
bootstrapOverWebsocket();
}
};

export default bootstrap;
export default bootstrapOverWebsocket;