Polish the logic about updating last synced time.
- Update the date right after corresponding operations, and before reloading any "table view".
This commit is contained in:
parent
66688b5f66
commit
0197444e30
6 changed files with 15 additions and 13 deletions
|
|
@ -27,15 +27,14 @@ class Utils {
|
|||
removeFileIfExists(atPath: url.path)
|
||||
}
|
||||
|
||||
static func getLastUpdatedTimeString() -> String {
|
||||
var lastUpdatedTimeString = ""
|
||||
if let lastUpdatedTime = Defaults[.lastUpdatedTime] {
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateStyle = .medium
|
||||
formatter.timeStyle = .short
|
||||
lastUpdatedTimeString = formatter.string(from: lastUpdatedTime)
|
||||
static func getLastSyncedTimeString() -> String {
|
||||
guard let lastSyncedTime = Defaults[.lastSyncedTime] else {
|
||||
return "Oops! Sync again?"
|
||||
}
|
||||
return lastUpdatedTimeString
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateStyle = .medium
|
||||
formatter.timeStyle = .short
|
||||
return formatter.string(from: lastSyncedTime)
|
||||
}
|
||||
|
||||
static func generatePassword(length: Int) -> String{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue