Skip to content

Commit

Permalink
Merge pull request #512 from agaertner/add_hasSubtoken
Browse files Browse the repository at this point in the history
add "HasSubtoken"
  • Loading branch information
dlamkins authored Apr 2, 2024
2 parents 3fb24bd + 032ada3 commit e609b90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Blish HUD/GameServices/Gw2WebApi/ManagedConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@ public bool SetApiKey(string apiKey) {
return true;
}

public bool HasApiKey() {
return !string.IsNullOrEmpty(_internalConnection.AccessToken);
}
}
}
2 changes: 2 additions & 0 deletions Blish HUD/GameServices/Modules/Managers/Gw2ApiManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ internal static async Task RenewAllSubtokens() {

public event EventHandler<ValueEventArgs<IEnumerable<TokenPermission>>> SubtokenUpdated;

public bool HasSubtoken => _connection.HasApiKey();

public IGw2WebApiClient Gw2ApiClient => _connection.Client;

public List<TokenPermission> Permissions => _permissions.ToList();
Expand Down

0 comments on commit e609b90

Please sign in to comment.