2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix ability to load exisiting database

This commit is contained in:
Ankit Singhaniya 2021-09-04 21:27:58 +05:30 committed by 18alantom
parent 0ed6cc48c6
commit eae8057571

View File

@ -41,22 +41,18 @@ export async function createNewDatabase() {
}
}
export function loadExistingDatabase() {
return new Promise(resolve => {
remote.dialog.showOpenDialog(
remote.getCurrentWindow(),
{
title: _('Select file'),
properties: ['openFile'],
filters: [{ name: 'SQLite DB File', extensions: ['db'] }]
},
files => {
if (files && files[0]) {
resolve(files[0]);
}
}
);
});
export async function loadExistingDatabase() {
const options = {
title: _('Select file'),
properties: ['openFile'],
filters: [{ name: 'SQLite DB File', extensions: ['db'] }]
};
let { filePaths } = await remote.dialog.showOpenDialog(options);
if (filePaths && filePaths[0]) {
return filePaths[0]
}
}
export async function connectToLocalDatabase(filepath) {