Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2013 from jbalsas/jbalsas/recent-projects-drop
Browse files Browse the repository at this point in the history
Fix for dropping projects when cancelling switch (#1780)
  • Loading branch information
redmunds committed Nov 2, 2012
2 parents 22df335 + 3be8717 commit 119f22e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/extensions/default/RecentProjects/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ define(function (require, exports, module) {
SidebarView = brackets.getModule("project/SidebarView"),
Menus = brackets.getModule("command/Menus"),
PopUpManager = brackets.getModule("widgets/PopUpManager"),
FileUtils = brackets.getModule("file/FileUtils");
FileUtils = brackets.getModule("file/FileUtils"),
NativeFileSystem = brackets.getModule("file/NativeFileSystem").NativeFileSystem;

var $dropdownToggle;
var MAX_PROJECTS = 20;
Expand Down Expand Up @@ -145,10 +146,14 @@ define(function (require, exports, module) {
.click(function () {
ProjectManager.openProject(root)
.fail(function () {
// Remove the project from the list.
// Remove the project from the list only if it does not exist on disk
var index = recentProjects.indexOf(root);
if (index !== -1) {
recentProjects.splice(index, 1);
NativeFileSystem.requestNativeFileSystem(root,
function () {},
function () {
recentProjects.splice(index, 1);
});
}
});
closeDropdown();
Expand Down

0 comments on commit 119f22e

Please sign in to comment.