mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-10-07 12:37:06 -04:00
fix: Change behavior of cancel request
*now cancel request cancel all requests
This commit is contained in:
@ -151,18 +151,17 @@ void ClientInterface::clearMessages()
|
||||
|
||||
void ClientInterface::cancelRequest()
|
||||
{
|
||||
auto id = m_chatModel->lastMessageId();
|
||||
|
||||
for (auto it = m_activeRequests.begin(); it != m_activeRequests.end(); ++it) {
|
||||
if (it.value().originalRequest["id"].toString() == id) {
|
||||
const RequestContext &ctx = it.value();
|
||||
const RequestContext &ctx = it.value();
|
||||
if (ctx.provider && ctx.provider->httpClient()) {
|
||||
ctx.provider->httpClient()->cancelRequest(it.key());
|
||||
|
||||
m_activeRequests.erase(it);
|
||||
m_accumulatedResponses.remove(it.key());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_activeRequests.clear();
|
||||
m_accumulatedResponses.clear();
|
||||
|
||||
LOG_MESSAGE("All requests cancelled and state cleared");
|
||||
}
|
||||
|
||||
void ClientInterface::handleLLMResponse(
|
||||
|
Reference in New Issue
Block a user