fix: Prevent API key banner from displaying when key is unavailable (#7356)

fix: prevent displaying API key banner when key is not available

- Added a conditional check to ensure the API key banner is only displayed if a valid API key is retrieved. This improves user experience by avoiding unnecessary prompts.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-03-31 13:38:13 -03:00 committed by GitHub
commit b4124a4027
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -591,7 +591,8 @@ def api_key(
unmasked_api_key = asyncio.run(aapi_key())
# Create a banner to display the API key and tell the user it won't be shown again
api_key_banner(unmasked_api_key)
if unmasked_api_key:
api_key_banner(unmasked_api_key)
def show_version(*, value: bool):