Skip to content

Commit

Permalink
FIX FIX NOTES
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Nov 26, 2018
1 parent 19b3529 commit 2b84dc7
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions client/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,37 @@ export class App extends Component {

const answer = await this.showDialog(getContentChangedDialog());

if (answer == 'ok') {
if (answer === 'ok') {
const updatedFile = await fileSystem.readFile(file.path);

assign(file, updatedFile);
this.updateTab(tab, {
file: {
updatedFile
}
});
}

}

/**
* Update the tab with new attributes.
*
* @param {Object} tab
* @param {Object} newAttrs
*/
updateTab(tab, newAttrs) {

await this.workspaceChanged();
await this.handleTabChanged(tab)();
await this.tabRef.current.triggerAction('set-last-xml', updatedFile.contents);
if (newAttrs.id && newAttrs.id !== tab.id) {
throw new Error('must not change tab.id');
}

// updatedTab = { ...tab, newAttrs }
//
// replace all occurences of 'tab' in app state (history, activeTab, tabs, openedTabs)
// with updatedTab
//
// ooops, where is the tab referenced right now? need to find all occurences
// and update the tab respectively
}

setActiveTab(tab) {
Expand Down

0 comments on commit 2b84dc7

Please sign in to comment.