1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-28 17:20:13 +02:00

save to "code" key whenever currentItem is set so that it opens on next reload

This commit is contained in:
Kushagra Gour
2019-03-18 15:54:52 +05:30
parent 00a00d38ec
commit c5462aab4c
2 changed files with 9 additions and 2 deletions

View File

@@ -416,7 +416,10 @@ export default class App extends Component {
item.jsMode = item.jsMode || this.state.prefs.jsMode || JsModes.JS;
}
this.setState({ currentItem: item }, d.resolve);
this.setState({ currentItem: item }, () => {
d.resolve();
this.saveCode('code');
});
// Reset auto-saving flag
this.isAutoSavingEnabled = false;