Skip to content
Snippets Groups Projects
Commit 361a9d73 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Make sure to put history in try/catch so it can be used with selenium

Selenium loads the playground using the file:// protocol, where history.replaceState throws an error
parent 29e738cb
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,11 @@ class SBFileUploader extends React.Component {
nonInteraction: true
});
// Remove the hash if any (without triggering a hash change event or a reload)
history.replaceState({}, document.title, '.');
try { // Can fail e.g. when GUI is loaded from static file (integration tests)
history.replaceState({}, document.title, '.');
} catch {
// No fallback, just do not trigger promise catch below
}
this.props.onLoadingFinished(this.props.loadingState, true);
// Reset the file input after project is loaded
// This is necessary in case the user wants to reload a project
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment