Skip to content

Commit

Permalink
app: fix wrong split size set in file mode
Browse files Browse the repository at this point in the history
  • Loading branch information
chinchang committed May 29, 2019
1 parent bba0787 commit 9220439
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export default class App extends Component {
};
window.onbeforeunload = event => {
if (this.state.unsavedEditCount) {
console.log(9999999999);
event.preventDefault();
// Chrome requires returnValue to be set.
event.returnValue = '';
Expand Down Expand Up @@ -254,7 +253,7 @@ export default class App extends Component {
}

async loadLanguage(lang) {
console.log('🇯🇲 fetching defninition');
log('🇯🇲 fetching defninition');

const catalog = await import(/* webpackMode: "lazy", webpackChunkName: "i18n-[index]" */ `../locales/${lang}/messages.js`);

Expand Down Expand Up @@ -418,7 +417,12 @@ export default class App extends Component {

this.setState({ currentItem: item }, () => {
d.resolve();
this.saveCode('code');
// savecode will try to get split sizes from DOM, and DOM
// will update after sometime. so delay the saving
setTimeout(() => {
// Save locally so that something which is simply opened (or created newly) and closed without save can opened the next time
this.saveCode('code');
}, 2000);
});

// Reset auto-saving flag
Expand Down Expand Up @@ -1315,8 +1319,6 @@ export default class App extends Component {
zip.file(externalLib.fileName, externalLib.code);
}

// console.log('ORIGINAL', this.calculateTextSize(fileContent));

var promise = null;
if (0 && JSZip.support.uint8array) {
promise = zip.generateAsync({ type: 'uint8array' });
Expand Down

0 comments on commit 9220439

Please sign in to comment.