mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
NetworkRequests now executes error callback on gui thread
This commit is contained in:
parent
b1d9b55bf7
commit
adbe92bd60
|
@ -135,8 +135,10 @@ void loadUncached(const std::shared_ptr<NetworkData> &data)
|
||||||
reply->abort();
|
reply->abort();
|
||||||
if (data->onError_)
|
if (data->onError_)
|
||||||
{
|
{
|
||||||
data->onError_(
|
postToThread([data] {
|
||||||
NetworkResult({}, NetworkResult::timedoutStatus));
|
data->onError_(NetworkResult(
|
||||||
|
{}, NetworkResult::timedoutStatus));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -157,7 +159,10 @@ void loadUncached(const std::shared_ptr<NetworkData> &data)
|
||||||
{
|
{
|
||||||
if (data->onError_)
|
if (data->onError_)
|
||||||
{
|
{
|
||||||
data->onError_(NetworkResult({}, reply->error()));
|
auto error = reply->error();
|
||||||
|
postToThread([data, error] {
|
||||||
|
data->onError_(NetworkResult({}, error));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue