Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'Close Workspace' #3386

Merged
merged 1 commit into from
Nov 5, 2018
Merged

Fix 'Close Workspace' #3386

merged 1 commit into from
Nov 5, 2018

Conversation

vince-fugnitto
Copy link
Member

Fixes #2662

  • Fixed issue with the command Close Workspace which did not work on all browsers
  • Since the function setMostRecentlyUsedWorkspace returns a Promise, it was necessary to await until the data is saved in recentWorkspace.json before reloading Theia

Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com

@vince-fugnitto vince-fugnitto added the bug bugs found in the application label Nov 2, 2018
Fixes #2662

- Fixed issue with the command `Close Workspace` which did not work on all browsers
- Since the function `setMostRecentlyUsedWorkspace` returns a Promise, it was necessary to `await` until the data is saved in `recentWorkspace.json` before reloading Theia

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
Copy link
Contributor

@simark simark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but a committer should approve.

@vince-fugnitto
Copy link
Member Author

thanks @simark, I'll wait to see what @elaihau thinks too

this._workspace = undefined;
this._roots.length = 0;

this.server.setMostRecentlyUsedWorkspace('');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could talk on Monday in person. Like Simon, I don't really understand the difference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to make sure to await the call this.server.setMostRecentlyUsedWorkspace('') in order for the backend to properly finish updating before Theia can reload. What I noticed in Firefox for example is that the update never resolves so when Theia reloads it reloads with the workspace that was opened before the Close Workspace was called.

Copy link
Contributor

@lmcbout lmcbout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine in Chrome and Firefox

@elaihau elaihau merged commit 29fbbb7 into master Nov 5, 2018
@elaihau elaihau deleted the fix-close-workspace branch November 5, 2018 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants