Skip to content

Commit

Permalink
fix(App): do not reopen unsaved Tabs
Browse files Browse the repository at this point in the history
closes #4110
  • Loading branch information
marstamm committed Feb 7, 2024
1 parent 8edacef commit a84caa4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions client/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,9 @@ export class App extends PureComponent {

if (!this.isUnsaved(tab)) {
closedTabs.push(tab);
recentTabs.push(tab);
}

recentTabs.push(tab);

if (activeTab === tab) {

const tabIdx = tabs.indexOf(tab);
Expand Down
17 changes: 17 additions & 0 deletions client/src/app/__tests__/AppSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,23 @@ describe('<App>', function() {
});


it('should NOT track unsaved files', async function() {

// given
const unsavedTab1 = openedTabs[0];

// when
await app.closeTab(unsavedTab1);

// when
const {
recentTabs
} = app.state;

expect(recentTabs).to.eql([ ]);
});


it('reopen recent tab', async function() {

// given
Expand Down

0 comments on commit a84caa4

Please sign in to comment.