Do not show 0 if numbers in "About Repository" cannot be obtained properly
This commit is contained in:
parent
f47e7d384c
commit
744b46adc2
3 changed files with 18 additions and 12 deletions
|
|
@ -105,16 +105,16 @@ public class PasswordStore {
|
|||
return (try? fm.allocatedSizeOfDirectoryAtURL(directoryURL: self.storeURL)) ?? 0
|
||||
}
|
||||
|
||||
public var numberOfLocalCommits: Int {
|
||||
return (try? getLocalCommits()?.count ?? 0) ?? 0
|
||||
public var numberOfLocalCommits: Int? {
|
||||
return (try? getLocalCommits())?.flatMap { $0.count }
|
||||
}
|
||||
|
||||
public var lastSyncedTime: Date? {
|
||||
return SharedDefaults[.lastSyncedTime]
|
||||
}
|
||||
|
||||
public var numberOfCommits: UInt {
|
||||
return storeRepository?.numberOfCommits(inCurrentBranch: nil) ?? 0
|
||||
public var numberOfCommits: UInt? {
|
||||
return storeRepository?.numberOfCommits(inCurrentBranch: nil)
|
||||
}
|
||||
|
||||
private init() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue