mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Various fixes
This commit is contained in:
parent
c0f9eb63f4
commit
f90ca9e7dd
@ -682,37 +682,16 @@ public class ContactsController: ViewController {
|
|||||||
|
|
||||||
let deleteContactsFromDevice: Signal<Never, NoError>
|
let deleteContactsFromDevice: Signal<Never, NoError>
|
||||||
if let contactDataManager = self.context.sharedContext.contactDataManager {
|
if let contactDataManager = self.context.sharedContext.contactDataManager {
|
||||||
deleteContactsFromDevice = contactDataManager.deleteContactWithAppSpecificReference(peerId: peerIds.first!)
|
deleteContactsFromDevice = combineLatest(peerIds.map { contactDataManager.deleteContactWithAppSpecificReference(peerId: $0) }
|
||||||
|
)
|
||||||
|
|> ignoreValues
|
||||||
} else {
|
} else {
|
||||||
deleteContactsFromDevice = .complete()
|
deleteContactsFromDevice = .complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
var deleteSignal = self.context.engine.contacts.deleteContacts(peerIds: peerIds)
|
let deleteSignal = self.context.engine.contacts.deleteContacts(peerIds: peerIds)
|
||||||
|> then(deleteContactsFromDevice)
|
|> then(deleteContactsFromDevice)
|
||||||
|
|
||||||
let progressSignal = Signal<Never, NoError> { [weak self] subscriber in
|
|
||||||
guard let self else {
|
|
||||||
return EmptyDisposable
|
|
||||||
}
|
|
||||||
let statusController = OverlayStatusController(theme: presentationData.theme, type: .loading(cancelled: nil))
|
|
||||||
self.present(statusController, in: .window(.root))
|
|
||||||
return ActionDisposable { [weak statusController] in
|
|
||||||
Queue.mainQueue().async() {
|
|
||||||
statusController?.dismiss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|> runOn(Queue.mainQueue())
|
|
||||||
|> delay(0.15, queue: Queue.mainQueue())
|
|
||||||
let progressDisposable = progressSignal.start()
|
|
||||||
|
|
||||||
deleteSignal = deleteSignal
|
|
||||||
|> afterDisposed {
|
|
||||||
Queue.mainQueue().async {
|
|
||||||
progressDisposable.dispose()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for peerId in peerIds {
|
for peerId in peerIds {
|
||||||
deleteSendMessageIntents(peerId: peerId)
|
deleteSendMessageIntents(peerId: peerId)
|
||||||
}
|
}
|
||||||
@ -724,6 +703,9 @@ public class ContactsController: ViewController {
|
|||||||
}
|
}
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let _ = deleteSignal.start()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
} else if value == .undo {
|
} else if value == .undo {
|
||||||
self.contactsNode.contactListNode.updatePendingRemovalPeerIds { state in
|
self.contactsNode.contactListNode.updatePendingRemovalPeerIds { state in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user