mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Wait until the sync has stopped before marking the task as complete. (#3564)
This commit is contained in:
@@ -2346,6 +2346,41 @@ class ClientProxyMock: ClientProxyProtocol {
|
||||
stopSyncCallsCount += 1
|
||||
stopSyncClosure?()
|
||||
}
|
||||
//MARK: - stopSync
|
||||
|
||||
var stopSyncCompletionUnderlyingCallsCount = 0
|
||||
var stopSyncCompletionCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return stopSyncCompletionUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = stopSyncCompletionUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
stopSyncCompletionUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
stopSyncCompletionUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var stopSyncCompletionCalled: Bool {
|
||||
return stopSyncCompletionCallsCount > 0
|
||||
}
|
||||
var stopSyncCompletionClosure: (((() -> Void)?) -> Void)?
|
||||
|
||||
func stopSync(completion: (() -> Void)?) {
|
||||
stopSyncCompletionCallsCount += 1
|
||||
stopSyncCompletionClosure?(completion)
|
||||
}
|
||||
//MARK: - accountURL
|
||||
|
||||
var accountURLActionUnderlyingCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user