refactor: Remove Outcome from network requests (#4959)

This commit is contained in:
nerix
2023-11-12 14:51:51 +01:00
committed by GitHub
parent 95620e6e10
commit 6faf63c5c4
22 changed files with 122 additions and 228 deletions
+2 -4
View File
@@ -26,11 +26,11 @@ void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
const auto url = constructRecentMessagesUrl(channelName);
NetworkRequest(url)
.onSuccess([channelPtr, onLoaded](const auto &result) -> Outcome {
.onSuccess([channelPtr, onLoaded](const auto &result) {
auto shared = channelPtr.lock();
if (!shared)
{
return Failure;
return;
}
qCDebug(LOG) << "Successfully loaded recent messages for"
@@ -65,8 +65,6 @@ void load(const QString &channelName, std::weak_ptr<Channel> channelPtr,
onLoaded(messages);
});
return Success;
})
.onError([channelPtr, onError](const NetworkResult &result) {
auto shared = channelPtr.lock();