saving and displaying the configured library dir
This commit is contained in:
+17
-6
@@ -1,19 +1,30 @@
|
||||
import './pico.css';
|
||||
import { DirectoryPicker } from '../wailsjs/go/main/App';
|
||||
import { DirectoryPicker, GetLibraryDir } from '../wailsjs/go/main/App';
|
||||
|
||||
|
||||
let libraryDirectoryLabel = document.getElementById("library-directory-label");
|
||||
|
||||
window.dirPicker = function () {
|
||||
GetLibraryDir().
|
||||
then((result) => {
|
||||
if (result.length === 0) { return; }
|
||||
window.updateLibraryDirLabel(result);
|
||||
}).catch((err) => { console.error(err) })
|
||||
|
||||
window.dirPicker = function() {
|
||||
var dir;
|
||||
try {
|
||||
DirectoryPicker()
|
||||
.then((result) => {libraryDirectoryLabel.innerText = result;})
|
||||
.catch((err) => {
|
||||
console.log("There is an error with directory picker")
|
||||
console.error(err);});
|
||||
.then((result) => { window.updateLibraryDirLabel(result); })
|
||||
.catch((err) => {
|
||||
console.log("There is an error with directory picker")
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
window.updateLibraryDirLabel = function(value) {
|
||||
libraryDirectoryLabel.innerText = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user