mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Start using the new synchronous stopSync method
This commit is contained in:
committed by
Stefan Ceriu
parent
9c1c51645f
commit
caa4abe659
@@ -166,19 +166,9 @@ class ClientProxy: ClientProxyProtocol {
|
||||
slidingSyncObserverToken = slidingSync?.sync()
|
||||
}
|
||||
|
||||
func stopSync(completionHandler: () -> Void) {
|
||||
guard let slidingSyncObserverToken else {
|
||||
MXLog.info("No sync is present")
|
||||
return
|
||||
}
|
||||
stopSync()
|
||||
while !slidingSyncObserverToken.isFinished() { }
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
func stopSync() {
|
||||
MXLog.info("Stopping sync")
|
||||
slidingSyncObserverToken?.cancel()
|
||||
slidingSync?.stopSync()
|
||||
slidingSyncObserverToken = nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user