From 7db07fa95779ca445430ae722521140bb6805a22 Mon Sep 17 00:00:00 2001 From: overtake Date: Tue, 5 Oct 2021 20:27:07 +0300 Subject: [PATCH] small request changes --- .../Sources/TelegramEngine/Peers/InvitationLinks.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/InvitationLinks.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/InvitationLinks.swift index d702b6ad2a..5e52392195 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/InvitationLinks.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/InvitationLinks.swift @@ -650,6 +650,10 @@ public struct PeerInvitationImportersState: Equatable { public var hasLoadedOnce: Bool public var canLoadMore: Bool public var count: Int32 + + public var waitingCount: Int { + return importers.filter { $0.approvedBy == nil }.count + } } final class CachedPeerInvitationImporters: Codable { @@ -891,7 +895,8 @@ private final class PeerInvitationImportersContextImpl { self.actionDisposables.add(_internal_updateInvitationRequest(account: self.account, peerId: self.peerId, userId: peerId, approve: action == .approve).start()) var results = self.results - results.removeAll(where: { $0.peer.peerId == peerId}) + results.removeAll(where: { $0.peer.peerId == peerId }) + count -= 1 self.results = results self.updateState() self.updateCache()