saving and displaying the configured library dir

This commit is contained in:
2025-03-22 17:00:21 -05:00
parent e3f47c602f
commit eba3187f39
5 changed files with 32 additions and 7 deletions
+17 -6
View File
@@ -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;
}