Skip to content

Commit

Permalink
feat(client/App): save workspace on component update
Browse files Browse the repository at this point in the history
Related to #866
Related to #910
  • Loading branch information
philippfromme authored and barmac committed Jan 17, 2019
1 parent 80362cd commit bc10807
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions client/src/app/App.js
Expand Up @@ -199,8 +199,6 @@ export class App extends Component {
}

await this._removeTab(tab);

this.saveWorkspace();
}

isDirty = (tab) => {
Expand Down Expand Up @@ -332,14 +330,12 @@ export class App extends Component {

this.setState({
layout: merge(layout, newLayout)
}, () => {

// wait for new state
this.saveWorkspace();
});
}

saveWorkspace = () => {
console.log('saveWorkspace');

const {
workspace
} = this.props.globals;
Expand Down Expand Up @@ -416,8 +412,6 @@ export class App extends Component {
[activeTab.id]: true
},
tabLoadingState: 'shown'
}, () => {
this.saveWorkspace();
});
}

Expand Down Expand Up @@ -473,8 +467,6 @@ export class App extends Component {
...dirtyTabs,
[tab.id]: false
}
}, () => {
this.saveWorkspace();
});
}

Expand Down Expand Up @@ -568,6 +560,8 @@ export class App extends Component {

}

// TODO(philippfromme): only save workspace if necessary
this.saveWorkspace();
}

async saveTab(tab, options = {}) {
Expand Down

0 comments on commit bc10807

Please sign in to comment.