saving and displaying the configured library dir
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
<title>yellowjacket</title>
|
||||
</head>
|
||||
<script src="./src/main.js" type="module"></script>
|
||||
<script>
|
||||
import {GetLibraryDir} from './wailsjs/go/main/App';
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<header class="container">
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -2,3 +2,5 @@
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
export function DirectoryPicker():Promise<string>;
|
||||
|
||||
export function GetLibraryDir():Promise<string>;
|
||||
|
||||
@@ -5,3 +5,7 @@
|
||||
export function DirectoryPicker() {
|
||||
return window['go']['main']['App']['DirectoryPicker']();
|
||||
}
|
||||
|
||||
export function GetLibraryDir() {
|
||||
return window['go']['main']['App']['GetLibraryDir']();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user