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 nikku committed Dec 1, 2018
1 parent 1df0fd4 commit 8b0728c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions client/src/app/App.js
Original file line number Diff line number Diff line change
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 8b0728c

Please sign in to comment.