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

Commit 119f22e

Browse files
committed
Merge pull request #2013 from jbalsas/jbalsas/recent-projects-drop
Fix for dropping projects when cancelling switch (#1780)
2 parents 22df335 + 3be8717 commit 119f22e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

  • src/extensions/default/RecentProjects

src/extensions/default/RecentProjects/main.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ define(function (require, exports, module) {
4040
SidebarView = brackets.getModule("project/SidebarView"),
4141
Menus = brackets.getModule("command/Menus"),
4242
PopUpManager = brackets.getModule("widgets/PopUpManager"),
43-
FileUtils = brackets.getModule("file/FileUtils");
43+
FileUtils = brackets.getModule("file/FileUtils"),
44+
NativeFileSystem = brackets.getModule("file/NativeFileSystem").NativeFileSystem;
4445

4546
var $dropdownToggle;
4647
var MAX_PROJECTS = 20;
@@ -145,10 +146,14 @@ define(function (require, exports, module) {
145146
.click(function () {
146147
ProjectManager.openProject(root)
147148
.fail(function () {
148-
// Remove the project from the list.
149+
// Remove the project from the list only if it does not exist on disk
149150
var index = recentProjects.indexOf(root);
150151
if (index !== -1) {
151-
recentProjects.splice(index, 1);
152+
NativeFileSystem.requestNativeFileSystem(root,
153+
function () {},
154+
function () {
155+
recentProjects.splice(index, 1);
156+
});
152157
}
153158
});
154159
closeDropdown();

0 commit comments

Comments
 (0)