state: fix broken file import

This commit is contained in:
jean-emmanuel 2018-03-20 09:37:49 +01:00
parent de93a8cb5d
commit c4102be9c3
2 changed files with 3 additions and 2 deletions

View file

@ -6,6 +6,7 @@
- error when resizing a widget and its clone(s) at the same time
- error with non string css property
- session list not reappearing when failing to load
- broken state file loading
- misc
- added a loading indicator when uploading a session file or a state file

View file

@ -85,7 +85,7 @@ var StateManager = class StateManager {
var prompt = DOM.create('<input type="file" accept=".state"/>')
prompt.click()
prompt.addEventListener('change',function(e){
prompt.addEventListener('change',(e)=>{
var reader = new FileReader(),
loader = loading('Uploading file...')
@ -98,7 +98,7 @@ var StateManager = class StateManager {
reader.onload = (e)=>{
loader.close()
this.set(JSON.parse(e.target.result),true)
this.state = preset
this.state = e.target.result
}