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:
parent
0ed6cc48c6
commit
eae8057571
28
src/utils.js
28
src/utils.js
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user