Skip to content

Commit 1ca887f

Browse files
committed
fix syncing notification
1 parent b770d33 commit 1ca887f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/ParseCareKit/ParseRemote.swift

+3
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ public class ParseRemote: OCKRemoteSynchronizable {
780780

781781
guard let parseClock = potentialPCKClock,
782782
let cloudClock = potentialCKClock else {
783+
self.isSynchronizing = false
783784
guard let parseError = error else {
784785
// There was a different issue that we don't know how to handle
785786
if #available(iOS 14.0, watchOS 7.0, *) {
@@ -809,12 +810,14 @@ public class ParseRemote: OCKRemoteSynchronizable {
809810
cloudVector.merge(with: localClock)
810811

811812
guard let updatedClock = parseClock.encodeClock(cloudVector) else {
813+
self.isSynchronizing = false
812814
completion(ParseCareKitError.couldntUnwrapClock)
813815
return
814816
}
815817

816818
// If clocks incremented or new clock introduced, no need to save to Cloud.
817819
guard shouldIncrementCloudClock || (!shouldIncrementCloudClock && cloudClock.uuids.count != localClock.uuids.count) else {
820+
self.isSynchronizing = false
818821
// Clocks not updated, no need to update cloud.
819822
self.parseRemoteDelegate?.successfullyPushedDataToCloud()
820823
completion(nil)

0 commit comments

Comments
 (0)