Kenric Nugteren 2 лет назад
Родитель
Сommit
67252abec9
3 измененных файлов с 6 добавлено и 5 удалено
  1. 1 0
      prs.shared/PRS.Shared.csproj
  2. 2 2
      prs.shared/Update.cs
  3. 3 3
      prs.stores/BaseStore.cs

+ 1 - 0
prs.shared/PRS.Shared.csproj

@@ -9,6 +9,7 @@
   </PropertyGroup>
 
   <ItemGroup>
+    <ProjectReference Include="..\..\inabox\inabox.client.rest\InABox.Client.Rest\InABox.Client.Rest.csproj" />
     <ProjectReference Include="..\..\InABox\InABox.Core\InABox.Core.csproj" />
     <ProjectReference Include="..\..\InABox\InABox.Database\InABox.Database.csproj" />
     <ProjectReference Include="..\..\InABox\InABox.WPF\InABox.Wpf.csproj" />

+ 2 - 2
prs.shared/Update.cs

@@ -1,4 +1,5 @@
 using Comal.Classes;
+using InABox.Clients;
 using InABox.Core;
 using InABox.DynamicGrid;
 using InABox.WPF;
@@ -23,8 +24,7 @@ namespace PRS.Shared
     {
         public static RestResponse GetRemoteFile(string location)
         {
-            var uri = new Uri(location);
-            var client = new RestClient(Uri.EscapeUriString(location));
+            var client = StaticRestClients.GetClient(Uri.EscapeUriString(location));
             var versionrequest = new RestRequest(Uri.EscapeUriString(location), Method.Get);
             return client.Execute(versionrequest);
         }

+ 3 - 3
prs.stores/BaseStore.cs

@@ -63,7 +63,7 @@ namespace Comal.Stores
             {
                 platform.Version = Version;
 
-                if(Platform == Platform.Wpf || Platform == Platform.Mobile)
+                if(Platform == Platform.Wpf || Platform == Platform.TimeBench)
                 {
                     var user = Provider.Load(new Filter<User>(x => x.UserID).IsEqualTo(UserID)).FirstOrDefault();
                     if(user is not null)
@@ -71,7 +71,7 @@ namespace Comal.Stores
                         var current = Platform switch
                         {
                             Platform.Wpf => user.Platform.DesktopVersion,
-                            Platform.Mobile => user.Platform.MobileVersion,
+                            Platform.TimeBench => user.Platform.MobileVersion,
                             _ => ""
                         };
                         if (!Version.Equals(current))
@@ -81,7 +81,7 @@ namespace Comal.Stores
                                 case Platform.Wpf:
                                     user.Platform.DesktopVersion = Version;
                                     break;
-                                case Platform.Mobile:
+                                case Platform.TimeBench:
                                     user.Platform.MobileVersion = Version;
                                     break;
                             }