mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +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 {
|
} catch {
|
||||||
if (!isTest) {
|
if (!isTest) {
|
||||||
ensureDirectory(getAppDataPath());
|
ensureDirectory(getAppDataPath());
|
||||||
fs.writeFileSync(lastLoadedProjectConfigPath, JSON.stringify({ lastLoadedProject: 'default.json' }));
|
fs.writeFileSync(lastLoadedProjectConfigPath, JSON.stringify({ lastLoadedProject: 'db.json' }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const lastLoadedProject = getLastLoadedProject();
|
const lastLoadedProject = getLastLoadedProject();
|
||||||
const configDbDirectory = lastLoadedProject ? 'uploads' : config.database.directory;
|
|
||||||
|
|
||||||
// path to public db
|
// 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 resolveDbPath = join(resolveDbDirectory, lastLoadedProject ? lastLoadedProject : config.database.filename);
|
||||||
export const pathToStartDb = isTest
|
export const pathToStartDb = isTest
|
||||||
? join(currentDirectory, '../', config.database.testdb, config.database.filename)
|
? join(currentDirectory, '../', config.database.testdb, config.database.filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user