Copilot: Fix spinner if Copilot not configure

Previously the progress indicator would be visible if node.js or the
lsp path was not configured.

Change-Id: Ief235253c6cfcb8f8fb533fe746edc7d0cc5867c
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2023-05-25 15:39:20 +02:00
parent 4136b6e795
commit c995795d80

View File

@@ -91,9 +91,13 @@ void AuthWidget::updateClient(const Utils::FilePath &nodeJs, const Utils::FilePa
{
LanguageClientManager::shutdownClient(m_client);
m_client = nullptr;
setState(Tr::tr("Sign in"), true);
if (!nodeJs.exists() || !agent.exists())
setState(Tr::tr("Sign in"), false);
m_button->setEnabled(false);
if (!nodeJs.exists() || !agent.exists()) {
return;
}
setState(Tr::tr("Sign in"), true);
m_client = new CopilotClient(nodeJs, agent);
connect(m_client, &Client::initialized, this, &AuthWidget::checkStatus);