remove introduction and about in cache

This commit is contained in:
josc146 2023-05-29 21:41:44 +08:00
parent 50bee24e8c
commit 7fb27b927c
2 changed files with 1 additions and 12 deletions

View File

@ -1,6 +1,6 @@
import commonStore from './stores/commonStore'; import commonStore from './stores/commonStore';
import { GetPlatform, ReadJson } from '../wailsjs/go/backend_golang/App'; import { GetPlatform, ReadJson } from '../wailsjs/go/backend_golang/App';
import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshModels, saveCache } from './utils'; import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshModels } from './utils';
import { getStatus } from './apis'; import { getStatus } from './apis';
import { EventsOn } from '../wailsjs/runtime'; import { EventsOn } from '../wailsjs/runtime';
import { defaultModelConfigs } from './pages/Configs'; import { defaultModelConfigs } from './pages/Configs';
@ -35,7 +35,6 @@ async function initRemoteText() {
commonStore.setIntroduction(data.introduction); commonStore.setIntroduction(data.introduction);
if (data.about) if (data.about)
commonStore.setAbout(data.about); commonStore.setAbout(data.about);
saveCache();
} }
}); });
} }
@ -61,10 +60,6 @@ async function initConfig() {
async function initCache() { async function initCache() {
await ReadJson('cache.json').then((cacheData: Cache) => { await ReadJson('cache.json').then((cacheData: Cache) => {
if (cacheData.introduction)
commonStore.setIntroduction(cacheData.introduction);
if (cacheData.about)
commonStore.setAbout(cacheData.about);
if (cacheData.depComplete) if (cacheData.depComplete)
commonStore.setDepComplete(cacheData.depComplete); commonStore.setDepComplete(cacheData.depComplete);
}).catch(() => { }).catch(() => {

View File

@ -16,13 +16,9 @@ import { Button } from '@fluentui/react-components';
import { Language, Languages, SettingsType } from '../pages/Settings'; import { Language, Languages, SettingsType } from '../pages/Settings';
import { ModelSourceItem } from '../pages/Models'; import { ModelSourceItem } from '../pages/Models';
import { ModelConfig, ModelParameters } from '../pages/Configs'; import { ModelConfig, ModelParameters } from '../pages/Configs';
import { IntroductionContent } from '../pages/Home';
import { AboutContent } from '../pages/About';
export type Cache = { export type Cache = {
models: ModelSourceItem[] models: ModelSourceItem[]
introduction: IntroductionContent,
about: AboutContent
depComplete: boolean depComplete: boolean
} }
@ -153,8 +149,6 @@ export const saveConfigs = async () => {
export const saveCache = async () => { export const saveCache = async () => {
const data: Cache = { const data: Cache = {
models: commonStore.modelSourceList, models: commonStore.modelSourceList,
introduction: commonStore.introduction,
about: commonStore.about,
depComplete: commonStore.depComplete depComplete: commonStore.depComplete
}; };
return SaveJson('cache.json', data); return SaveJson('cache.json', data);