WIP profile UX
This commit is contained in:
parent
597a7753a4
commit
2bb55330c2
5 changed files with 26 additions and 11 deletions
|
|
@ -33,7 +33,6 @@ namespace BookAStar
|
|||
public static IPlatform PlatformSpecificInstance { get; set; }
|
||||
public static string AppName { get; set; }
|
||||
|
||||
|
||||
[Obsolete("Instead using this, use new static properties.")]
|
||||
public static App CurrentApp { get { return Current as App; } }
|
||||
|
||||
|
|
@ -64,7 +63,7 @@ namespace BookAStar
|
|||
MainSettings.UserChanged += MainSettings_UserChanged;
|
||||
CrossConnectivity.Current.ConnectivityChanged += (conSender, args) =>
|
||||
{ App.IsConnected = args.IsConnected; };
|
||||
SetupHubConnection();
|
||||
MainSettings_UserChanged(this, null);
|
||||
if (CrossConnectivity.Current.IsConnected)
|
||||
StartHubConnection();
|
||||
}
|
||||
|
|
@ -341,20 +340,21 @@ namespace BookAStar
|
|||
}
|
||||
);
|
||||
});
|
||||
MainSettings_UserChanged(this, null);
|
||||
}
|
||||
|
||||
private void MainSettings_UserChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (MainSettings.CurrentUser == null)
|
||||
{
|
||||
chatHubConnection.Headers.Clear();
|
||||
chatHubConnection.Dispose();
|
||||
chatHubConnection = null;
|
||||
chatHubProxy = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var token = MainSettings.CurrentUser.YavscTokens.AccessToken;
|
||||
chatHubConnection.Headers.Add(
|
||||
"Authorization", $"Bearer {token}");
|
||||
SetupHubConnection();
|
||||
chatHubConnection.Headers.Add("Authorization", $"Bearer {token}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue