From 0fc429f5a3cb3727ba09cea18d93591c188829fe Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 29 May 2023 20:37:00 +0800 Subject: [PATCH] chore --- frontend/src/startup.ts | 14 +++++++++----- main.go | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/src/startup.ts b/frontend/src/startup.ts index 50b5e29..52e1b95 100644 --- a/frontend/src/startup.ts +++ b/frontend/src/startup.ts @@ -4,6 +4,7 @@ import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshModels, s import { getStatus } from './apis'; import { EventsOn } from '../wailsjs/runtime'; import { defaultModelConfigs } from './pages/Configs'; +import manifest from '../../manifest.json'; export async function startup() { downloadProgramFiles(); @@ -28,11 +29,14 @@ export async function startup() { async function initRemoteText() { await fetch('https://cdn.jsdelivr.net/gh/josstorer/RWKV-Runner@master/manifest.json', { cache: 'no-cache' }) .then(r => r.json()).then((data) => { - if (data.introduction) - commonStore.setIntroduction(data.introduction); - if (data.about) - commonStore.setAbout(data.about); - }).then(saveCache); + if (data.version > manifest.version) { + if (data.introduction) + commonStore.setIntroduction(data.introduction); + if (data.about) + commonStore.setAbout(data.about); + saveCache(); + } + }); } async function initConfig() { diff --git a/main.go b/main.go index 7450ee1..31dc6cf 100644 --- a/main.go +++ b/main.go @@ -23,9 +23,9 @@ var cyacInfo embed.FS var py embed.FS func main() { - go backend.CopyEmbed(cyac) - go backend.CopyEmbed(cyacInfo) - go backend.CopyEmbed(py) + backend.CopyEmbed(cyac) + backend.CopyEmbed(cyacInfo) + backend.CopyEmbed(py) // Create an instance of the app structure app := backend.NewApp()