@@ -25,7 +25,7 @@ public class GitHubUpdateService
2525 if ( ! response . IsSuccessStatusCode )
2626 {
2727 Logger . Warning ( $ "Failed to check for updates. Status code: { response . StatusCode } ") ;
28- ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , $ "无法检查更新,请检查网络连接。\n Code: { response . StatusCode } ", NotificationType . Error ) ;
28+ _ = ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , $ "无法检查更新,请检查网络连接。\n Code: { response . StatusCode } ", NotificationType . Error ) ;
2929 return ( false , null , null , null ) ;
3030 }
3131
@@ -35,14 +35,14 @@ public class GitHubUpdateService
3535
3636 if ( release == null )
3737 {
38- ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,未找到版本信息。" , NotificationType . Error ) ;
38+ _ = ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,未找到版本信息。" , NotificationType . Error ) ;
3939 return ( false , null , null , null ) ;
4040 }
4141
4242 var tagName = release [ "tag_name" ] ? . ToString ( ) ;
4343 if ( string . IsNullOrEmpty ( tagName ) )
4444 {
45- ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,未找到版本信息。" , NotificationType . Error ) ;
45+ _ = ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,未找到版本信息。" , NotificationType . Error ) ;
4646 return ( false , null , null , null ) ;
4747 }
4848
@@ -52,7 +52,7 @@ public class GitHubUpdateService
5252 if ( ! Version . TryParse ( ServiceManager . Version , out var currentVersion ) )
5353 {
5454 Logger . Warning ( $ "Failed to parse current version: { ServiceManager . Version } ") ;
55- ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,当前版本信息格式错误。" , NotificationType . Error ) ;
55+ _ = ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,当前版本信息格式错误。" , NotificationType . Error ) ;
5656 return ( false , null , null , null ) ;
5757 }
5858
@@ -69,13 +69,13 @@ public class GitHubUpdateService
6969 else
7070 {
7171 Logger . Warning ( $ "Failed to parse latest version: { cleanTagName } ") ;
72- ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,版本信息格式错误。" , NotificationType . Error ) ;
72+ _ = ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , "无法检查更新,版本信息格式错误。" , NotificationType . Error ) ;
7373 }
7474 return ( false , null , null , null ) ;
7575 }
7676 catch ( Exception ex )
7777 {
78- ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , $ "检查更新时出错: { ex . Message } ", NotificationType . Error ) ;
78+ _ = ServiceManager . Services . GetService < IToastService > ( ) ! . Show ( "更新" , $ "检查更新时出错: { ex . Message } ", NotificationType . Error ) ;
7979 Logger . Error ( ex , "Error checking for updates" ) ;
8080 return ( false , null , null , null ) ;
8181 }
0 commit comments