Ensure LocalUser is never null

This commit is contained in:
Dean Herbert 2017-05-16 19:49:50 +09:00
parent d1c198d9bf
commit 2384f7b0c1
1 changed files with 8 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public class APIAccess : IUpdateable
public string Password;
public Bindable<User> LocalUser = new Bindable<User>();
public Bindable<User> LocalUser = new Bindable<User>(createGustUser());
public string Token
{
@ -295,8 +295,15 @@ public void Logout()
clearCredentials();
authentication.Clear();
State = APIState.Offline;
LocalUser.Value = createGustUser();
}
private static User createGustUser() => new User
{
Username = @"Guest",
Id = 1,
};
public void Update()
{
Scheduler.Update();