From 8b0728cf843d0998ec45fb1e468161383ed8cd45 Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Thu, 20 Sep 2018 17:19:24 +0200 Subject: [PATCH] feat(client/App): save workspace on component update Related to #866 Related to #910 --- client/src/app/App.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/client/src/app/App.js b/client/src/app/App.js index 34fab915f6..b5653be736 100644 --- a/client/src/app/App.js +++ b/client/src/app/App.js @@ -199,8 +199,6 @@ export class App extends Component { } await this._removeTab(tab); - - this.saveWorkspace(); } isDirty = (tab) => { @@ -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; @@ -416,8 +412,6 @@ export class App extends Component { [activeTab.id]: true }, tabLoadingState: 'shown' - }, () => { - this.saveWorkspace(); }); } @@ -473,8 +467,6 @@ export class App extends Component { ...dirtyTabs, [tab.id]: false } - }, () => { - this.saveWorkspace(); }); } @@ -568,6 +560,8 @@ export class App extends Component { } + // TODO(philippfromme): only save workspace if necessary + this.saveWorkspace(); } async saveTab(tab, options = {}) {