diff --git a/BodyshopUploader/ImEXOnlinePartner.nuspec b/BodyshopUploader/ImEXOnlinePartner.nuspec
index 54959b7..79d041a 100644
--- a/BodyshopUploader/ImEXOnlinePartner.nuspec
+++ b/BodyshopUploader/ImEXOnlinePartner.nuspec
@@ -12,6 +12,7 @@
ImEX Online Partner
-
+
+
\ No newline at end of file
diff --git a/BodyshopUploader/Utils/UpdateHandler.cs b/BodyshopUploader/Utils/UpdateHandler.cs
index 2a2656a..2e5a925 100644
--- a/BodyshopUploader/Utils/UpdateHandler.cs
+++ b/BodyshopUploader/Utils/UpdateHandler.cs
@@ -14,7 +14,7 @@ namespace BodyshopPartner.Utils
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
- public const string UpdatePath = @"https://update.partner.imex.online";
+ public const string UpdatePath = @"http://partner.imex.online/";
public static async Task AreUpdatesAvailable()
{
@@ -55,6 +55,7 @@ namespace BodyshopPartner.Utils
{
var updateInfo = await updateManager.CheckForUpdate();
var releases = updateInfo.ReleasesToApply;
+ logger.Debug("Applying releases", releases.ToString());
await updateManager.DownloadReleases(releases, _ => { DownloadProgress = _; });
await updateManager.ApplyReleases(updateInfo, _ => { InstallProgress = _; });
}
diff --git a/BodyshopUploader/ViewModels/MainViewModel.cs b/BodyshopUploader/ViewModels/MainViewModel.cs
index 045ad27..df8f433 100644
--- a/BodyshopUploader/ViewModels/MainViewModel.cs
+++ b/BodyshopUploader/ViewModels/MainViewModel.cs
@@ -83,15 +83,24 @@ namespace BodyshopPartner.ViewModels
_callingThread.ReportProgress(80);
logger.Debug("VM Init Complete");
Task.Run(() => Utils.HTTPServer.InitHttpServer(AddHttpStatus));
+ Task.Run(() => updateCheck());
_callingThread.ReportProgress(100);
}
+
+ private async Task updateCheck()
+ {
+ logger.Debug("Checking if updates are available.");
+ if (await Utils.UpdateHandler.AreUpdatesAvailable())
+ {
+ logger.Debug("Updates are available! Installing.");
+ await Utils.UpdateHandler.ApplyUpdates(Progress, Progress);
+ }
+ }
+
private async void _updateTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
- if (await Utils.UpdateHandler.AreUpdatesAvailable())
- {
- await Utils.UpdateHandler.ApplyUpdates(Progress, Progress);
- }
+ await updateCheck();
}
private void MonitoringPathsChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
@@ -206,7 +215,7 @@ namespace BodyshopPartner.ViewModels
IndeterminateLoading = true;
foreach (var s in ShopData)
{
- if (s.Id == ActiveShop.Id) s.AssociationActive = true;
+ if (s.Id == ActiveShop?.Id) s.AssociationActive = true;
else s.AssociationActive = false;
var r = new GraphQLRequest
{
@@ -228,10 +237,10 @@ namespace BodyshopPartner.ViewModels
};
await Utils.GraphQL.ExecuteQuery(r);
}
- Properties.Settings.Default.LastSelectedShop = ActiveShop.Id;
+ Properties.Settings.Default.LastSelectedShop = ActiveShop?.Id;
Properties.Settings.Default.Save();
- Utils.AppMetaData.ActiveShopId = ActiveShop.Id;
- Utils.AppMetaData.ShopRegion = ActiveShop.RegionConfig;
+ Utils.AppMetaData.ActiveShopId = ActiveShop?.Id;
+ Utils.AppMetaData.ShopRegion = ActiveShop?.RegionConfig;
IndeterminateLoading = false;
}
diff --git a/BodyshopUploader/ViewModels/MainViewModel.props.cs b/BodyshopUploader/ViewModels/MainViewModel.props.cs
index c8cf20b..de84148 100644
--- a/BodyshopUploader/ViewModels/MainViewModel.props.cs
+++ b/BodyshopUploader/ViewModels/MainViewModel.props.cs
@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using BodyshopPartner.Utils.Growls;
using BodyshopPartner.Models;
+using System.Reflection;
namespace BodyshopPartner.ViewModels
{
@@ -55,5 +56,12 @@ namespace BodyshopPartner.ViewModels
get { return _httpServerLog; }
set { SetProperty(ref _httpServerLog, value); }
}
+
+ private string _appVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ public string AppVersion
+ {
+ get { return _appVersion; }
+ set { SetProperty(ref _appVersion, value); }
+ }
}
}
diff --git a/BodyshopUploader/Views/Main.xaml b/BodyshopUploader/Views/Main.xaml
index 1fa60c4..4f29997 100644
--- a/BodyshopUploader/Views/Main.xaml
+++ b/BodyshopUploader/Views/Main.xaml
@@ -11,7 +11,7 @@
xmlns:vm="clr-namespace:BodyshopPartner.ViewModels"
mc:Ignorable="d"
Title="{x:Static p:Resources.Title_Main}"
- Height="450"
+ Height="489.819"
Width="800"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
@@ -108,7 +108,7 @@
-
+
-
+
@@ -149,6 +149,9 @@
Command="{Binding TestCommand}"
Background="Tomato"
Content="_TEST COMMAND" />
+
@@ -216,10 +219,12 @@
-
+
+ materialDesign:HintAssist.Hint="{x:Static p:Resources.Label_QbFilePath}"
+ TextChanged="TextBox_TextChanged" />
ImEX Online Partner
-
+
+
\ No newline at end of file