فهرست منبع

Fixed 500 status codes

Krzysztof Krysiński 1 ماه پیش
والد
کامیت
9ecb78c493

+ 6 - 6
src/PixiEditor.PixiAuth/PixiAuthClient.cs

@@ -46,7 +46,7 @@ public class PixiAuthClient
         {
             throw new BadRequestException(await response.Content.ReadAsStringAsync());
         }
-        else if (response.StatusCode == HttpStatusCode.InternalServerError)
+        else if (response.StatusCode >= HttpStatusCode.InternalServerError)
         {
             throw new InternalServerErrorException("INTERNAL_SERVER_ERROR");
         }
@@ -101,7 +101,7 @@ public class PixiAuthClient
         {
             throw new BadRequestException(await response.Content.ReadAsStringAsync());
         }
-        else if (response.StatusCode == HttpStatusCode.InternalServerError)
+        else if (response.StatusCode >= HttpStatusCode.InternalServerError)
         {
             throw new InternalServerErrorException("INTERNAL_SERVER_ERROR");
         }
@@ -208,7 +208,7 @@ public class PixiAuthClient
                 }
             }
         }
-        else if (response.StatusCode == HttpStatusCode.InternalServerError)
+        else if (response.StatusCode >= HttpStatusCode.InternalServerError)
         {
             throw new InternalServerErrorException("INTERNAL_SERVER_ERROR");
         }
@@ -227,7 +227,7 @@ public class PixiAuthClient
             throw new BadRequestException(await response.Content.ReadAsStringAsync());
         }
 
-        if (response.StatusCode == HttpStatusCode.InternalServerError)
+        if (response.StatusCode >= HttpStatusCode.InternalServerError)
         {
             throw new InternalServerErrorException("INTERNAL_SERVER_ERROR");
         }
@@ -261,7 +261,7 @@ public class PixiAuthClient
             throw new BadRequestException(await response.Content.ReadAsStringAsync());
         }
 
-        if (response.StatusCode == HttpStatusCode.InternalServerError)
+        if (response.StatusCode >= HttpStatusCode.InternalServerError)
         {
             throw new InternalServerErrorException("INTERNAL_SERVER_ERROR");
         }
@@ -299,7 +299,7 @@ public class PixiAuthClient
             throw new BadRequestException(await response.Content.ReadAsStringAsync());
         }
 
-        if (response.StatusCode == HttpStatusCode.InternalServerError)
+        if (response.StatusCode >= HttpStatusCode.InternalServerError)
         {
             throw new InternalServerErrorException("INTERNAL_SERVER_ERROR");
         }

+ 2 - 2
src/PixiEditor/Initialization/ClassicDesktopEntry.cs

@@ -277,7 +277,7 @@ internal class ClassicDesktopEntry
     {
         string? baseUrl = RuntimeConstants.PixiEditorApiUrl;
 #if DEBUG
-        if (baseUrl != null && baseUrl.Contains('{') && baseUrl.Contains('}'))
+        if (baseUrl == null)
         {
             string? envUrl = Environment.GetEnvironmentVariable("PIXIEDITOR_API_URL");
             if (envUrl != null)
@@ -294,7 +294,7 @@ internal class ClassicDesktopEntry
     {
         string? apiKey = RuntimeConstants.PixiEditorApiKey;
 #if DEBUG
-        if (apiKey != null && apiKey.Contains('{') && apiKey.Contains('}'))
+        if (apiKey == null)
         {
             string? envApiKey = Environment.GetEnvironmentVariable("PIXIEDITOR_API_KEY");
             if (envApiKey != null)

+ 1 - 0
src/PixiEditor/ViewModels/User/OwnedProductViewModel.cs

@@ -62,6 +62,7 @@ public class OwnedProductViewModel : ObservableObject
                 IsInstalling = true;
                 bool wasUpdating = UpdateAvailable;
                 UpdateAvailable = false;
+                RestartRequired = false;
                 await installContentCommand.ExecuteAsync(ProductData.Id);
                 IsInstalling = false;
                 if (wasUpdating)

+ 1 - 0
src/PixiEditor/Views/Auth/UserAvatarToggle.axaml

@@ -99,6 +99,7 @@
                                                             <MultiBinding Converter="{converters:AllTrueConverter}">
                                                                 <Binding Path="IsInstalled" />
                                                                 <Binding Path="!UpdateAvailable" />
+                                                                <Binding Path="!IsInstalling" />
                                                             </MultiBinding>
                                                         </TextBlock.IsVisible>
                                                         <Run Classes="pixi-icon"