mirror of
https://github.com/mue/mue.git
synced 2026-07-17 05:54:14 +02:00
fix: sideload tab and file uploads
This commit is contained in:
@@ -330,7 +330,7 @@ export default class Create extends PureComponent {
|
||||
id="file-input"
|
||||
type="settings"
|
||||
accept="application/json"
|
||||
loadFunction={(e) => this.importSettings(JSON.parse(e.target.result))}
|
||||
loadFunction={(e) => this.importSettings(JSON.parse(e))}
|
||||
/>
|
||||
</SettingsItem>
|
||||
<div className="createButtons">
|
||||
|
||||
@@ -14,7 +14,9 @@ export default class FileUpload extends PureComponent {
|
||||
|
||||
if (this.props.type === 'settings') {
|
||||
reader.readAsText(file, 'UTF-8');
|
||||
return this.props.loadFunction(e);
|
||||
reader.onload = (e) => {
|
||||
return this.props.loadFunction(e.target.result);
|
||||
}
|
||||
} else {
|
||||
// background upload
|
||||
const settings = {};
|
||||
|
||||
Reference in New Issue
Block a user