display models that have not been fully downloaded in Downloads page, even if the program is restarted

This commit is contained in:
josc146
2023-06-23 16:03:57 +08:00
parent 447f4572b1
commit 97f6af595e
7 changed files with 73 additions and 19 deletions

View File

@@ -16,7 +16,7 @@ export async function startup() {
await GetPlatform().then(p => commonStore.setPlatform(p as Platform));
await initConfig();
initCache().then(initRemoteText); // depends on config customModelsPath
initCache(true).then(initRemoteText); // depends on config customModelsPath
if (commonStore.settings.autoUpdatesCheck) // depends on config settings
checkUpdate();
@@ -58,11 +58,11 @@ async function initConfig() {
});
}
async function initCache() {
async function initCache(initUnfinishedModels: boolean) {
await ReadJson('cache.json').then((cacheData: Cache) => {
if (cacheData.depComplete)
commonStore.setDepComplete(cacheData.depComplete);
}).catch(() => {
});
await refreshModels(false);
await refreshModels(false, initUnfinishedModels);
}