Skip to content

Commit

Permalink
fix local storage edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigopivi committed Aug 22, 2018
1 parent dd3cfb5 commit 1bb2277
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions web/components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ export default class Editor extends React.Component<{}, IEditorState> {
const localTabs = this.loadFromLocalIfPresent('tabs', true);
const localAdapterOptions = this.loadFromLocalIfPresent('adapterOptions', true);
const localCurrentAdapter = this.loadFromLocalIfPresent('currentAdapter', false);
if (localTabs) {
this.tabs = localTabs;
}
this.tabs = localTabs ? localTabs : tabs;
if (localAdapterOptions) {
newState.adapterOptions = localAdapterOptions;
newState.useCustomOptions = true;
Expand All @@ -354,8 +352,8 @@ export default class Editor extends React.Component<{}, IEditorState> {
this.setState(newState, cb);
} else {
this.tabs = tabs;
cb();
}
cb();
};

private changeTab = (i: number, cb?: () => void) => {
Expand Down

0 comments on commit 1bb2277

Please sign in to comment.