diff --git a/src/components/load-button/load-button.jsx b/src/components/load-button/load-button.jsx index 0f580278cdf7659ba819c1e345d7b220ceed013b..2623b7118b91bec77c08b465103f43c4999370ef 100644 --- a/src/components/load-button/load-button.jsx +++ b/src/components/load-button/load-button.jsx @@ -25,6 +25,7 @@ const LoadButtonComponent = ({ {title} </ButtonComponent> <input + accept=".sb,.sb2,.sb3,.zip" disabled className={styles.fileInput} ref={inputRef} diff --git a/src/containers/load-button.jsx b/src/containers/load-button.jsx index b3804d8c5b1529bdd2f35589cb92032f12d9bb87..e52a6735da91bb32005c531ddd35e267ea58e541 100644 --- a/src/containers/load-button.jsx +++ b/src/containers/load-button.jsx @@ -25,8 +25,10 @@ class LoadButton extends React.Component { } handleChange (e) { this.props.openLoadingState(); + // Remove the hash if any (without triggering a hash change event or a reload) + history.replaceState({}, document.title, '.'); const reader = new FileReader(); - reader.onload = () => this.props.vm.loadProjectLocal(reader.result) + reader.onload = () => this.props.vm.loadProject(reader.result) .then(() => { this.props.closeLoadingState(); }) @@ -64,7 +66,7 @@ LoadButton.propTypes = { closeLoadingState: PropTypes.func, openLoadingState: PropTypes.func, vm: PropTypes.shape({ - loadProjectLocal: PropTypes.func + loadProject: PropTypes.func }) };