2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 02:49:03 +00:00

fix: use fallback if documents not available

This commit is contained in:
18alantom 2023-08-18 16:00:33 +05:30
parent f95a93860a
commit a0cea8683e

View File

@ -41,7 +41,13 @@ export default function registerIpcMainActionListeners(main: Main) {
ipcMain.handle(
IPC_ACTIONS.GET_DB_DEFAULT_PATH,
async (_, companyName: string) => {
let root = app.getPath('documents');
let root: string;
try {
root = app.getPath('documents');
} catch {
root = app.getPath('userData');
}
if (main.isDevelopment) {
root = 'dbs';
}