Don't show authentication on app start if authentication is valid

dashboard
Pat Hartl 2023-01-26 01:19:49 -06:00
parent a42619ea8c
commit 7f93f806fd
1 changed files with 5 additions and 2 deletions

View File

@ -55,14 +55,17 @@ namespace LANCommander.PlaynitePlugin
public override void OnApplicationStarted(OnApplicationStartedEventArgs args) public override void OnApplicationStarted(OnApplicationStartedEventArgs args)
{ {
ShowAuthenticationWindow(); if (LANCommander.Token == null || !LANCommander.ValidateToken(LANCommander.Token))
{
ShowAuthenticationWindow();
}
} }
public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args) public override IEnumerable<GameMetadata> GetGames(LibraryGetGamesArgs args)
{ {
var gameMetadata = new List<GameMetadata>(); var gameMetadata = new List<GameMetadata>();
if (LANCommander.Token != null && !LANCommander.ValidateToken(LANCommander.Token)) if (LANCommander.Token == null || !LANCommander.ValidateToken(LANCommander.Token))
{ {
try try
{ {