This commit is contained in:
josc146
2023-05-18 22:48:37 +08:00
parent 18db41fd76
commit de7d6b3417
6 changed files with 38 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import {ListDirFiles, ReadJson, SaveJson} from '../../wailsjs/go/backend_golang/App';
import {DownloadFile, FileExists, ListDirFiles, ReadJson, SaveJson} from '../../wailsjs/go/backend_golang/App';
import manifest from '../../../manifest.json';
import commonStore, {ModelConfig, ModelParameters, ModelSourceItem} from '../stores/commonStore';
@@ -160,4 +160,19 @@ export function getUserLanguage(): Language {
export function isSystemLightMode() {
return window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches;
}
export function downloadProgramFiles() {
manifest.programFiles.forEach(({url, path}) => {
FileExists(path).then(exists => {
if (!exists)
DownloadFile(path, url);
});
});
}
export function forceDownloadProgramFiles() {
manifest.programFiles.forEach(({url, path}) => {
DownloadFile(path, url);
});
}