mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Refactor SecureBackupControllerListener into SDKListener and use it everywhere. (#4030)
This commit is contained in:
@@ -577,7 +577,7 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
private func subscribeToPagination() async {
|
||||
switch kind {
|
||||
case .live:
|
||||
let backPaginationListener = RoomPaginationStatusListener { [weak self] status in
|
||||
let backPaginationListener = SDKListener<RoomPaginationStatus> { [weak self] status in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
@@ -610,32 +610,6 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
private final class RoomPaginationStatusListener: PaginationStatusListener {
|
||||
private let onUpdateClosure: (RoomPaginationStatus) -> Void
|
||||
|
||||
init(_ onUpdateClosure: @escaping (RoomPaginationStatus) -> Void) {
|
||||
self.onUpdateClosure = onUpdateClosure
|
||||
}
|
||||
|
||||
func onUpdate(status: RoomPaginationStatus) {
|
||||
onUpdateClosure(status)
|
||||
}
|
||||
}
|
||||
|
||||
private final class UploadProgressListener: ProgressWatcher {
|
||||
private let onUpdateClosure: (Double) -> Void
|
||||
|
||||
init(_ onUpdateClosure: @escaping (Double) -> Void) {
|
||||
self.onUpdateClosure = onUpdateClosure
|
||||
}
|
||||
|
||||
func transmissionProgress(progress: TransmissionProgress) {
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.onUpdateClosure(Double(progress.current) / Double(progress.total))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension MatrixRustSDK.PollKind {
|
||||
init(pollKind: Poll.Kind) {
|
||||
switch pollKind {
|
||||
|
||||
Reference in New Issue
Block a user