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
This commit is contained in:
1 parent
29e738cb92
commit
361a9d7393
1 file changed
+5
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user