mirror of
https://github.com/frappe/books.git
synced 2024-11-08 14:50:56 +00:00
fix: use fallback if documents not available
This commit is contained in:
parent
f95a93860a
commit
a0cea8683e
@ -41,7 +41,13 @@ export default function registerIpcMainActionListeners(main: Main) {
|
|||||||
ipcMain.handle(
|
ipcMain.handle(
|
||||||
IPC_ACTIONS.GET_DB_DEFAULT_PATH,
|
IPC_ACTIONS.GET_DB_DEFAULT_PATH,
|
||||||
async (_, companyName: string) => {
|
async (_, companyName: string) => {
|
||||||
let root = app.getPath('documents');
|
let root: string;
|
||||||
|
try {
|
||||||
|
root = app.getPath('documents');
|
||||||
|
} catch {
|
||||||
|
root = app.getPath('userData');
|
||||||
|
}
|
||||||
|
|
||||||
if (main.isDevelopment) {
|
if (main.isDevelopment) {
|
||||||
root = 'dbs';
|
root = 'dbs';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user