diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-09-26 19:29:21 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2019-09-26 19:29:21 +0300 |
| commit | 7b22fc549089ea11a90486bcef0afbaba4efe3fa (patch) | |
| tree | 67d93bd62570b58d2e44835dd3e5553f9fc0859f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | 118436fbb6553e81cfeae70aa3c3a4576fce2b1c (diff) | |
| download | Tango-7b22fc549089ea11a90486bcef0afbaba4efe3fa.tar.gz Tango-7b22fc549089ea11a90486bcef0afbaba4efe3fa.zip | |
Fixed issue with BypassVersionCheck not loading modules.
Added ForceVersionUpdate setting.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
3 files changed, 18 insertions, 9 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index 2de61fd75..7fe1ae36a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -66,12 +66,19 @@ namespace Tango.MachineStudio.UI.Authentication /// <param name="password">The password.</param> /// <returns></returns> /// <exception cref="AuthenticationException">Login failed for user " + email</exception> - public AuthenticationLoginResult Login(string email, string password) + public AuthenticationLoginResult Login(string email, string password, bool bypassVersionCheck = false) { var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); _client.Environment = settings.DeploymentSlot; + var appVersion = AssemblyHelper.GetCurrentAssemblyVersion().ToString(); + + if (settings.ForceVersionUpdate) + { + appVersion = "1.0.0.0"; + } + LoginResponse response = null; try @@ -81,7 +88,7 @@ namespace Tango.MachineStudio.UI.Authentication Email = email, Password = password, - Version = AssemblyHelper.GetCurrentAssemblyVersion().ToString(), + Version = appVersion, }).Result; } @@ -90,12 +97,17 @@ namespace Tango.MachineStudio.UI.Authentication throw new AggregateException(new AuthenticationException("Error logging in to machine service."), ex); } + if (bypassVersionCheck) + { + response.VersionChangeRequired = false; + } + if (settings.Environment == MachineStudioSettings.WorkingEnvironment.Remote) { ObservablesContext.OverrideSettingsDataSource(response.DataSource); } - if (response.VersionChangeRequired) + if (response.VersionChangeRequired && !bypassVersionCheck) { return new AuthenticationLoginResult() { @@ -121,10 +133,7 @@ namespace Tango.MachineStudio.UI.Authentication throw new AuthenticationException("Invalid credentials for " + email); } - if (!response.VersionChangeRequired) - { - CurrentUser = user; - } + CurrentUser = user; return new AuthenticationLoginResult() { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs index c181d7b9d..cf34764d9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoginViewVM.cs @@ -158,7 +158,7 @@ namespace Tango.MachineStudio.UI.ViewModels { _settings.DeploymentSlot = DeploymentSlot; - LoginResponse result = _authenticationProvider.Login(Email, Password).Response; + LoginResponse result = _authenticationProvider.Login(Email, Password, _settings.ByPassEnvironmentVersionCheck).Response; if (result.VersionChangeRequired && !_settings.ByPassEnvironmentVersionCheck) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs index c40f91005..4a94322fb 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/UpdateViewVM.cs @@ -218,7 +218,7 @@ namespace Tango.MachineStudio.UI.ViewModels CheckForUpdatesResponse response = _machineStudioWebClient.CheckForUpdates(new CheckForUpdatesRequest() { - Version = _application.Version.ToString(), + Version = settings.ForceVersionUpdate ? "1.0.0.0" : _application.Version.ToString(), }).Result; if (response.IsUpdateAvailable) |
