From ccb32584ea511817223958376042daa8f9270d39 Mon Sep 17 00:00:00 2001 From: hermwong Date: Mon, 9 Mar 2015 16:20:56 -0700 Subject: [PATCH] [#314] added logic to removeMissingProjects to set a new active project after missing projects have been removed from localStorage Former-commit-id: db6e66d3ff6e3639fa28ec0eaac9f18f3958f9d7 --- www/js/local-storage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/js/local-storage.js b/www/js/local-storage.js index ba9f4f02..1edf63bb 100644 --- a/www/js/local-storage.js +++ b/www/js/local-storage.js @@ -92,7 +92,12 @@ function removeMissingProjects() { localStorage["projects"] = JSON.stringify(projects); - console.log(JSON.stringify(projects)); + console.log(JSON.stringify(projects)); + + // if there are still projects remaining, set an active widget + if (index > 0) { + setActiveWidget(projects[0].id, projects[0].projDir); + } }