Add project created with Save As to top of Recent Projects list
@@ -469,17 +469,7 @@ const openProject = async projectPath => {
return;
}
- // Store recent projects
- settings.set(
- "recentProjects",
- []
- .concat(settings.get("recentProjects") || [], projectPath)
- .reverse()
- .filter((filename, index, arr) => arr.indexOf(filename) === index) // Only unique
- .reverse()
- .slice(-10)
- );
- app.addRecentDocument(projectPath);
+ addRecentProject(projectPath);
const oldMainWindow = mainWindow;
await createWindow(projectPath);
@@ -493,6 +483,20 @@ const openProject = async projectPath => {
}
};
+const addRecentProject = (projectPath) => {
+ // Store recent projects
+ settings.set(
+ "recentProjects",
+ []
+ .concat(settings.get("recentProjects") || [], projectPath)
+ .reverse()
+ .filter((filename, index, arr) => arr.indexOf(filename) === index) // Only unique
+ .reverse()
+ .slice(-10)
+ );
+ app.addRecentDocument(projectPath);
+}
+
const saveAsProjectPicker = async () => {
const files = dialog.showSaveDialog({
filters: [
@@ -538,5 +542,7 @@ const saveAsProject = async saveAsPath => {
return;
}
+ addRecentProject(projectPath);
+
mainWindow && mainWindow.webContents.send("save-as-project", projectPath);
};
\ No newline at end of file
