mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
fix: fixed issue where there were no projects on the project list on the first load
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user