aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs27
1 files changed, 17 insertions, 10 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
index a8faeea7b..80a95d1bf 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
@@ -7,6 +7,7 @@ using Tango.BL.Entities;
using Tango.Core.Commands;
using Tango.Core.DI;
using Tango.Integration.ExternalBridge;
+using Tango.PMR.Integration;
using Tango.PPC.Common;
using Tango.PPC.Common.ExternalBridge;
using Tango.PPC.Common.Navigation;
@@ -115,12 +116,15 @@ namespace Tango.PPC.UI.ViewModels
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void ExternalBridgeService_ClientDisconnected(object sender, EventArgs e)
{
- LogManager.Log("External bridge client disconnected. Navigating to home module...");
-
- InvokeUI(() =>
+ if (IsVisible)
{
- NavigationManager.NavigateTo(NavigationView.HomeModule);
- });
+ LogManager.Log("External bridge client disconnected. Navigating to home module...");
+
+ InvokeUI(() =>
+ {
+ NavigationManager.NavigateTo(NavigationView.HomeModule);
+ });
+ }
}
/// <summary>
@@ -132,7 +136,7 @@ namespace Tango.PPC.UI.ViewModels
{
LogManager.Log($"External bridge connection request received.\n{e.ToJsonString()}");
- if (e.Request.Password == Settings.ExternalBridgePassword)
+ if (!e.Request.Intent.RequiresPassword() || e.Request.Password == Settings.ExternalBridgePassword)
{
e.Confirmed = true;
@@ -145,11 +149,14 @@ namespace Tango.PPC.UI.ViewModels
LogManager.Log($"External bridge connection user has been identified as {User.Contact.FullName}");
}
- LogManager.Log("Navigating to external bridge view...");
- InvokeUI(() =>
+ if (e.Request.Intent == ExternalBridgeLoginIntent.FullControl)
{
- NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false);
- });
+ LogManager.Log("Navigating to external bridge view...");
+ InvokeUI(() =>
+ {
+ NavigationManager.NavigateTo(NavigationView.ExternalBridgeView, false);
+ });
+ }
}
else
{