mirror of https://github.com/procxx/kepka.git
Fix request cancel in Histories.
This commit is contained in:
parent
f9d02740aa
commit
7f77db8c7f
|
@ -621,7 +621,11 @@ void Histories::finishSentRequest(
|
||||||
not_null<State*> state,
|
not_null<State*> state,
|
||||||
int id) {
|
int id) {
|
||||||
_historyByRequest.remove(id);
|
_historyByRequest.remove(id);
|
||||||
state->sent.remove(id);
|
const auto i = state->sent.find(id);
|
||||||
|
if (i != end(state->sent)) {
|
||||||
|
session().api().request(i->second.id).cancel();
|
||||||
|
state->sent.erase(i);
|
||||||
|
}
|
||||||
if (!state->postponed.empty() && !postponeHistoryRequest(*state)) {
|
if (!state->postponed.empty() && !postponeHistoryRequest(*state)) {
|
||||||
for (auto &[id, postponed] : base::take(state->postponed)) {
|
for (auto &[id, postponed] : base::take(state->postponed)) {
|
||||||
const auto requestId = postponed.generator([=] {
|
const auto requestId = postponed.generator([=] {
|
||||||
|
|
Loading…
Reference in New Issue