Merge pull request #1155 from tw0po1nt/1154-fix-inverted-sync-status-flags

Fix inverted sync status flags
This commit is contained in:
Lukas Korba 2023-07-03 15:10:41 +02:00 committed by GitHub
commit 8065aa718d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 12 deletions

View File

@ -336,17 +336,26 @@ public enum SyncStatus: Equatable {
case error(_ error: Error)
public var isSyncing: Bool {
guard case .syncing = self else { return true }
if case .syncing = self {
return true
}
return false
}
public var isSynced: Bool {
guard case .upToDate = self else { return true }
if case .upToDate = self {
return true
}
return false
}
public var isPrepared: Bool {
guard case .unprepared = self else { return false }
if case .unprepared = self {
return false
}
return true
}
@ -383,27 +392,27 @@ enum InternalSyncStatus: Equatable {
case error(_ error: Error)
public var isSyncing: Bool {
switch self {
case .syncing:
if case .syncing = self {
return true
default:
return false
}
return false
}
public var isSynced: Bool {
switch self {
case .synced: return true
default: return false
if case .synced = self {
return true
}
return false
}
public var isPrepared: Bool {
if case .unprepared = self {
return false
} else {
return true
}
return true
}
public var briefDebugDescription: String {