From cc40bed24d58680345642b1657e09e287e677b1f Mon Sep 17 00:00:00 2001 From: Serban Andrei Date: Sun, 18 Apr 2021 16:05:28 +0300 Subject: [PATCH 1/3] No longer tries to open deleted project on start --- source/plugins/projects/projects/index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/plugins/projects/projects/index.js b/source/plugins/projects/projects/index.js index 3a86b2d3..ff824d81 100644 --- a/source/plugins/projects/projects/index.js +++ b/source/plugins/projects/projects/index.js @@ -1202,11 +1202,15 @@ let projects = { let project = studio.settings.loadValue('projects', 'currentProject', null); let file = studio.settings.loadValue('projects', 'currentFile', null); - if (project !== {} && project !== null) { - if(await this.selectCurrentProject(project, false)) { - if (file !== {} && file !== null) { - await this.changeFile(project,file); - } + if (project !== {} && project !== null) { + if(await studio.filesystem.pathExists(project.folder)) { + if(await this.selectCurrentProject(project, false)) { + if (file !== {} && file !== null) { + await this.changeFile(project,file); + } + } + } else { + studio.workspace.showDialog(ProjectsLibrary, {width: 1000}); } } From ad9ab3606ac0989c185154c6551a3e3e21b95347 Mon Sep 17 00:00:00 2001 From: Serban Andrei Date: Sun, 18 Apr 2021 18:14:35 +0300 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Alexandru Radovici --- source/plugins/projects/projects/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/plugins/projects/projects/index.js b/source/plugins/projects/projects/index.js index ff824d81..fbed3cdd 100644 --- a/source/plugins/projects/projects/index.js +++ b/source/plugins/projects/projects/index.js @@ -1202,10 +1202,10 @@ let projects = { let project = studio.settings.loadValue('projects', 'currentProject', null); let file = studio.settings.loadValue('projects', 'currentFile', null); - if (project !== {} && project !== null) { + if (project !== null) { if(await studio.filesystem.pathExists(project.folder)) { if(await this.selectCurrentProject(project, false)) { - if (file !== {} && file !== null) { + if (file !== null) { await this.changeFile(project,file); } } From 338e9a5d92dfe77aebf6e0460212c8f03a4e8188 Mon Sep 17 00:00:00 2001 From: Serban Andrei Date: Sun, 18 Apr 2021 18:34:05 +0300 Subject: [PATCH 3/3] Fixed opening on a blank page --- source/plugins/projects/projects/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/plugins/projects/projects/index.js b/source/plugins/projects/projects/index.js index fbed3cdd..781fa204 100644 --- a/source/plugins/projects/projects/index.js +++ b/source/plugins/projects/projects/index.js @@ -1211,8 +1211,9 @@ let projects = { } } else { studio.workspace.showDialog(ProjectsLibrary, {width: 1000}); - } - + } + } else if(!studio.settings.loadValue('firstrun', 'firstRun', true)) { + studio.workspace.showDialog(ProjectsLibrary, {width: 1000}); } },