From ab0999d7d7f3f55cf5611b3a1b30657780f4dc13 Mon Sep 17 00:00:00 2001 From: Emmanuel De Saint Steban Date: Thu, 5 Jan 2023 10:48:23 +0100 Subject: [PATCH 1/2] chore(release.yml): Add publish to winget in release actions See information about this github actions here : https://github.com/marketplace/actions/winget-releaser ref : #142 --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce843c4..41c0f5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,3 +90,14 @@ jobs: # 📝: Edit the deployment directory publish_dir: ./updater force_orphan: true + + publish-winget: + # Action can only be run on windows + runs-on: windows-latest + needs: [create-release, build-tauri] + steps: + - uses: vedantmgoyal2009/winget-releaser@v1 + with: + identifier: lencx.ChatGPT + token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ env.version }} From a7cff0df66fd3870a0a365584a5fcb284ef2fa11 Mon Sep 17 00:00:00 2001 From: lencx Date: Fri, 6 Jan 2023 10:45:05 +0800 Subject: [PATCH 2/2] fix: build error --- src/layout/index.tsx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/layout/index.tsx b/src/layout/index.tsx index 99f70d4..2def6af 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -5,29 +5,35 @@ import { useNavigate, useLocation } from 'react-router-dom'; import { getName, getVersion } from '@tauri-apps/api/app'; import { invoke } from '@tauri-apps/api'; +import useInit from '@/hooks/useInit'; import Routes, { menuItems } from '@/routes'; import './index.scss'; const { Content, Footer, Sider } = Layout; -const appName = await getName(); -const appVersion = await getVersion(); -const appTheme = await invoke("get_theme"); - export default function ChatLayout() { const [collapsed, setCollapsed] = useState(false); + const [appInfo, setAppInfo] = useState>({}); const location = useLocation(); const go = useNavigate(); + useInit(async () => { + setAppInfo({ + appName: await getName(), + appVersion: await getVersion(), + appTheme: await invoke("get_theme"), + }); + }) + const checkAppUpdate = async () => { - await invoke('run_check_update', { silent: false }); + await invoke('run_check_update', { silent: false }); } return ( - + setCollapsed(value)} @@ -43,9 +49,9 @@ export default function ChatLayout() { >
- {appName} + {appInfo.appName} - {appVersion} + {appInfo.appVersion} @@ -55,7 +61,7 @@ export default function ChatLayout() {