File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ interface ToolVersion {
2323
2424export function AboutSection ( ) {
2525 const [ versionInfo , setVersionInfo ] = useState < VersionInfo > ( {
26- current : "0.14.0 " ,
26+ current : "" ,
2727 latest : undefined ,
2828 hasUpdate : false ,
2929 downloadUrl : undefined ,
@@ -33,6 +33,23 @@ export function AboutSection() {
3333 const [ toolVersions , setToolVersions ] = useState < ToolVersion [ ] > ( [ ] ) ;
3434 const [ loadingTools , setLoadingTools ] = useState ( true ) ;
3535
36+ // 加载当前版本号(从后端获取,确保与 Cargo.toml 同步)
37+ useEffect ( ( ) => {
38+ const loadCurrentVersion = async ( ) => {
39+ try {
40+ // check_for_updates 会返回当前版本号
41+ const result = await invoke < VersionInfo > ( "check_for_updates" ) ;
42+ setVersionInfo ( ( prev ) => ( {
43+ ...prev ,
44+ current : result . current ,
45+ } ) ) ;
46+ } catch ( error ) {
47+ console . error ( "Failed to load version:" , error ) ;
48+ }
49+ } ;
50+ loadCurrentVersion ( ) ;
51+ } , [ ] ) ;
52+
3653 // 加载本地工具版本
3754 useEffect ( ( ) => {
3855 const loadToolVersions = async ( ) => {
You can’t perform that action at this time.
0 commit comments