File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -535,27 +535,27 @@ public static async Task RequireGitAuthenticationAsync()
535
535
client . DefaultRequestHeaders . Add ( "Accept" , "application/json" ) ;
536
536
client . DefaultRequestHeaders . Add ( "User-Agent" , "Files App" ) ;
537
537
538
- HttpResponseMessage codeResponse ;
538
+ JsonDocument ? codeJsonContent ;
539
539
try
540
540
{
541
- codeResponse = await client . PostAsync (
541
+ var codeResponse = await client . PostAsync (
542
542
$ "https://github.com/login/device/code?client_id={ _clientId } &scope=repo",
543
543
new StringContent ( "" ) ) ;
544
- }
545
- catch
546
- {
547
- await DynamicDialogFactory . GetFor_GitHubConnectionError ( ) . TryShowAsync ( ) ;
548
- return ;
549
- }
550
544
551
- if ( ! codeResponse . IsSuccessStatusCode )
552
- {
553
- await DynamicDialogFactory . GetFor_GitHubConnectionError ( ) . TryShowAsync ( ) ;
554
- return ;
555
- }
545
+ if ( ! codeResponse . IsSuccessStatusCode )
546
+ {
547
+ await DynamicDialogFactory . GetFor_GitHubConnectionError ( ) . TryShowAsync ( ) ;
548
+ return ;
549
+ }
556
550
557
- var codeJsonContent = await codeResponse . Content . ReadFromJsonAsync < JsonDocument > ( ) ;
558
- if ( codeJsonContent is null )
551
+ codeJsonContent = await codeResponse . Content . ReadFromJsonAsync < JsonDocument > ( ) ;
552
+ if ( codeJsonContent is null )
553
+ {
554
+ await DynamicDialogFactory . GetFor_GitHubConnectionError ( ) . TryShowAsync ( ) ;
555
+ return ;
556
+ }
557
+ }
558
+ catch
559
559
{
560
560
await DynamicDialogFactory . GetFor_GitHubConnectionError ( ) . TryShowAsync ( ) ;
561
561
return ;
You can’t perform that action at this time.
0 commit comments