mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
Reload chatbot rules after adding an exception.
This commit is contained in:
parent
5381fe5a1a
commit
9f67b9ba2f
2 changed files with 9 additions and 0 deletions
|
@ -164,6 +164,7 @@ void Chatbots::removeFrom(not_null<PeerData*> peer) {
|
|||
api->requestPeerSettings(peer);
|
||||
}
|
||||
_sentRequests.remove(peer);
|
||||
reload();
|
||||
}).fail([=] {
|
||||
api->requestPeerSettings(peer);
|
||||
_sentRequests.remove(peer);
|
||||
|
@ -171,4 +172,10 @@ void Chatbots::removeFrom(not_null<PeerData*> peer) {
|
|||
_sentRequests[peer] = SentRequest{ type, id };
|
||||
}
|
||||
|
||||
void Chatbots::reload() {
|
||||
_loaded = false;
|
||||
_owner->session().api().request(base::take(_requestId)).cancel();
|
||||
preload();
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
|
|
|
@ -55,6 +55,8 @@ private:
|
|||
mtpRequestId requestId = 0;
|
||||
};
|
||||
|
||||
void reload();
|
||||
|
||||
const not_null<Session*> _owner;
|
||||
|
||||
rpl::variable<ChatbotsSettings> _settings;
|
||||
|
|
Loading…
Add table
Reference in a new issue