fix: fixed issue where there were no projects on the project list on the first load

This commit is contained in:
Ary
2024-01-31 20:28:39 -07:00
parent 91fd275564
commit 5b20a47ff6
+2 -3
View File
@@ -84,16 +84,15 @@ const getLastLoadedProject = () => {
} catch {
if (!isTest) {
ensureDirectory(getAppDataPath());
fs.writeFileSync(lastLoadedProjectConfigPath, JSON.stringify({ lastLoadedProject: 'default.json' }));
fs.writeFileSync(lastLoadedProjectConfigPath, JSON.stringify({ lastLoadedProject: 'db.json' }));
}
}
};
const lastLoadedProject = getLastLoadedProject();
const configDbDirectory = lastLoadedProject ? 'uploads' : config.database.directory;
// path to public db
export const resolveDbDirectory = join(testDbStartDirectory, isTest ? config.database.testdb : configDbDirectory);
export const resolveDbDirectory = join(testDbStartDirectory, isTest ? config.database.testdb : 'uploads');
export const resolveDbPath = join(resolveDbDirectory, lastLoadedProject ? lastLoadedProject : config.database.filename);
export const pathToStartDb = isTest
? join(currentDirectory, '../', config.database.testdb, config.database.filename)